ghc-lib-9.10.1.20240511: The GHC API, decoupled from GHC versions
Safe HaskellIgnore
LanguageGHC2021

GHC.Tc.Gen.Pat

Description

Typechecking patterns

Synopsis

Documentation

data LetBndrSpec Source #

Instances

Instances details
Outputable LetBndrSpec Source # 
Instance details

Defined in GHC.Tc.Gen.Pat

Methods

ppr :: LetBndrSpec -> SDoc #

tcCheckPat_O Source #

Arguments

:: HsMatchContextRn 
-> CtOrigin

origin to use if the type needs inst'ing

-> LPat GhcRn 
-> Scaled TcSigmaTypeFRR 
-> TcM a 
-> TcM (LPat GhcTc, a) 

A variant of tcPat that takes a custom origin

tcMatchPats Source #

Arguments

:: forall a. HsMatchContextRn 
-> [LPat GhcRn]

patterns

-> [ExpPatType]

types of the patterns

-> TcM a

checker for the body

-> TcM ([LPat GhcTc], a) 

isIrrefutableHsPatRnTcM :: Bool -> LPat GhcRn -> TcM Bool Source #

Very similar to GHC.Tc.Pat.isIrrefutableHsPat, but doesn't typecheck the pattern It does depend on the type checker monad (TcM) however as we need to check ConPat case in more detail. Specifically, we call tcLookupGlobal to obtain constructor details from global packages for a comprehensive irrefutability check and avoid false negatives. (testcase pattern-fails.hs)