Moduleghc-10.0.0.20260917GHC2024
GHC.Rename.Env
- 3 types
- 47 values
- Packageghc-10.0.0.20260917
- Exports50
- LanguageGHC2024
- LicenceBSD-3-Clause
- SourceEnv.hs
lookupOccRn looks up an occurrence of a RdrName, and uses its argument to determine what kind of suggestions should be displayed if it is not in scope
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 ParentGRE GlobalRdrElt [Name]The child has an incorrect parent
FoundChild GlobalRdrElt
Instances1Outputable
Outputable ChildLookupResultDefined in ghc-10.0.0.20260917 · GHC.Rename.Env
lookupSubBndrOcc_helper :: Boolmust have a parent
-> Boollook up in all namespaces
-> DeprecationWarnings-> ParentGREparent
-> RdrNamething we are looking up
-> RnM ChildLookupResult
Used in export lists to lookup the children.
Instances1Outputable
Outputable HsSigCtxtDefined in ghc-10.0.0.20260917 · GHC.Rename.Env
lookupSigCtxtOccRn :: HsSigCtxt-> SigLikewhat are we looking for, e.g. a 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.
irrefutableConLikeRn :: HasDebugCallStack=> HscEnv-> GlobalRdrEnv-> CompleteMatchesin-scope COMPLETE pragmas
-> WithUserRdr Name-> Bool
Check irrefutability of a ConLike in a 'ConPat GhcRn' (the 'Irref-ConLike' condition of Note [Irrefutability of ConPat]).
irrefutableConLikeTc :: NamedThing con=> [CompleteMatchX con]in-scope COMPLETE pragmas
-> ConLike-> Bool
Check irrefutability of the ConLike in a 'ConPat GhcTc' (the 'Irref-ConLike' condition of Note [Irrefutability of ConPat]), given all in-scope COMPLETE pragmas (CompleteMatches in the typechecker, DsCompleteMatches in the desugarer).
lookupSyntaxName :: NameThe standard name
-> RnM (Name, FreeNames)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)