Moduleghc-9.10.3GHC2021
GHC.Rename.Env
- 3 types
- 49 values
- Packageghc-9.10.3
- Exports52
- LanguageGHC2021
- LicenceBSD-3-Clause
- SourceEnv.hs
lookupInfoOccRn is intended for use in GHCi's ":info" command It finds all the GREs that RdrName could mean, not complaining about ambiguity, but rather returning them all (c.f. #9881).
lookupInfoOccRn is also used in situations where we check for at least one definition of the RdrName, not complaining about multiple definitions (see #17832).
Look up a RdrName used as a variable in an expression.
This may be a local variable, global variable, or one or more record selector
functions. It will not return record fields created with the
NoFieldSelectors extension (see Note [NoFieldSelectors]).
If the name is not in scope at the term level, but its promoted equivalent is in scope at the type level, the lookup will succeed (so that the type-checker can report a more informative error later). See Note [Promotion].
Look up an occurrence of a field in record construction or pattern matching (but not update).
If -XDisambiguateRecordFields is off, then we will pass Nothing for the DataCon Name, i.e. we don't use the data constructor for disambiguation. See Note [DisambiguateRecordFields] and Note [NoFieldSelectors].
Returns all possible collections of field labels for the given record update.
Example:
data D = MkD { fld1 :: Int, fld2 :: Bool } data E = MkE1 { fld1 :: Int, fld2 :: Bool, fld3 :: Char } | MkE2 { fld1 :: Int, fld2 :: Bool } data F = MkF1 { fld1 :: Int } | MkF2 { fld2 :: Bool }
f r = r { fld1 = a, fld2 = b }
This function will return:
- [ D.fld1, D.fld2
-- could be a record update at type D , [ E.fld1, E.fld2 ] -- could be a record update at type E ] -- cannot be a record update at type F: no constructor has both -- of the fields fld1 and fld2
If there are no valid parents for the record update, throws a TcRnBadRecordUpdate error.
Constructors
NameNotFoundWe couldn't find a suitable name
IncorrectParent Name GlobalRdrElt [Name]The child has an incorrect parent
FoundChild GlobalRdrElt
Instances1Outputable
Outputable ChildLookupResultDefined in ghc-9.10.3 · GHC.Rename.Env
lookupSubBndrOcc_helper :: Bool-> DeprecationWarnings-> Name-> RdrNamething we are looking up
-> LookupChildhow to look it up (e.g. which NameSpaces to look in)
-> RnM ChildLookupResult
Used in export lists to lookup the children.
Instances1Outputable
Outputable HsSigCtxtDefined in ghc-9.10.3 · GHC.Rename.Env
lookupSigCtxtOccRn :: HsSigCtxt-> SDocdescription of thing we're looking up, like "type family"
-> GenLocated (EpAnn ann) RdrName-> RnM (GenLocated (EpAnn ann) Name)
Lookup a name in relation to the names in a HsSigCtxt
Look up the arity and record fields of a constructor.
lookupSyntaxName :: NameThe standard name
-> RnM (Name, FreeVars)Possibly a non-standard name Lookup a Name that may be subject to Rebindable Syntax (RS).
When RS is off, just return the supplied (standard) Name
When RS is on, look up the OccName of the supplied Name; return what we find, or the supplied Name if there is nothing in scope
Whether to report deprecation warnings when registering a used GRE
There is no option to only emit declaration warnings since everywhere we emit the declaration warnings we also emit export warnings (See Note [Handling of deprecations] for details)