File tree Expand file tree Collapse file tree 4 files changed +29
-7
lines changed
src/Language/Haskell/Names Expand file tree Collapse file tree 4 files changed +29
-7
lines changed Original file line number Diff line number Diff line change @@ -52,9 +52,8 @@ annotateRec _ sc a = go sc a where
52
52
namesRes = do
53
53
f <- sc ^. wcNames
54
54
let localQName = qualifyName Nothing (setAnn (sLoc l) (wcFieldName f))
55
- selectorQName = qualifyName ( Just (wcFieldModuleName f)) (wcFieldName f)
55
+ symbol = wcFieldSymbol f
56
56
Scoped info _ <- return (lookupQName localQName sc)
57
- Scoped (GlobalSymbol symbol _) _ <- return (lookupQName selectorQName (exprRS sc))
58
57
return (symbol, info)
59
58
_ -> rmap go sc a
60
59
| Just (Refl :: PatField (Scoped l ) :~: a ) <- eqT
@@ -63,8 +62,7 @@ annotateRec _ sc a = go sc a where
63
62
PFieldWildcard (Scoped (RecPatWildcard namesRes) (sLoc l)) where
64
63
namesRes = do
65
64
f <- sc ^. wcNames
66
- let qname = qualifyName (Just (wcFieldModuleName f)) (wcFieldName f)
67
- Scoped (GlobalSymbol symbol _) _ <- return (lookupQName qname (exprRS sc))
65
+ let symbol = wcFieldSymbol f
68
66
return symbol
69
67
_ -> rmap go sc a
70
68
| otherwise
Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ type WcNames = [WcField]
26
26
data WcField = WcField
27
27
{ wcFieldName :: Name ()
28
28
-- ^ the field's simple name
29
- , wcFieldModuleName :: ModuleName ()
30
- -- ^ the field's original name
29
+ , wcFieldSymbol :: Symbol
30
+ -- ^ the field's selector symbol
31
31
, wcExistsGlobalValue :: Bool
32
32
-- ^ whether there is a global value in scope with the same name as
33
33
-- the field but different from the field selector
@@ -76,7 +76,7 @@ getElidedFields globalTable con fields =
76
76
let name = symbolName symbol
77
77
wcfield = WcField
78
78
{ wcFieldName = name
79
- , wcFieldModuleName = symbolModule symbol
79
+ , wcFieldSymbol = symbol
80
80
, wcExistsGlobalValue = existsGlobalValue name
81
81
}
82
82
return (name,wcfield))
Original file line number Diff line number Diff line change
1
+ {-# LANGUAGE RecordWildCards #-}
2
+ module WildcardsQualified where
3
+
4
+ import qualified Prelude as P (DataTypeWithSelectors (DataTypeWithSelectors ,selector1 ))
5
+
6
+ u :: DataTypeWithSelectors -> ()
7
+ u P. DataTypeWithSelectors {.. } = let x = selector1 in ()
8
+
Original file line number Diff line number Diff line change
1
+ RecordWildCards at 1:14 is none
2
+ DataTypeWithSelectors at 4:32 is import part for a global data type, Prelude.DataTypeWithSelectors
3
+ DataTypeWithSelectors at 4:54 is a global constructor, Prelude.DataTypeWithSelectors
4
+ selector1 at 4:76 is a global selector, Prelude.selector1
5
+ u at 6:1 is a global value, WildcardsQualified.u
6
+ DataTypeWithSelectors at 6:6 is not in scope
7
+ DataTypeWithSelectors at 6:6 is not in scope
8
+ () at 6:31 is none
9
+ u at 7:1 is a value bound here
10
+ DataTypeWithSelectors at 7:3 is a global constructor, Prelude.DataTypeWithSelectors
11
+ DataTypeWithSelectors at 7:3 is a global constructor, Prelude.DataTypeWithSelectors
12
+ .. at 7:27 is a record pattern wildcard which brings the following fields: Prelude.selector1
13
+ x at 7:37 is a value bound here
14
+ selector1 at 7:41 is a local value defined at 7:27
15
+ selector1 at 7:41 is a local value defined at 7:27
16
+ () at 7:54 is none
You can’t perform that action at this time.
0 commit comments