From 310424d05836ee8788c7c79f98243ef92330f5f1 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Mon, 3 Jan 2022 15:53:43 +0000 Subject: Correct type of static forms in hsExprType The simplest way to do this seemed to be to persist the whole type in the extension field from the typechecker so that the few relevant places * Desugaring can work out the return type by splitting this type rather than calling `dsExpr` (slightly more efficient). * hsExprType can just return the correct type. * Zonking has to now zonk the type as well The other option we considered was wiring in StaticPtr but that is actually quite tricky because StaticPtr refers to StaticPtrInfo which has field selectors (which we can't easily wire in). Fixes #20150 --- compiler/Language/Haskell/Syntax/Expr.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/Language/Haskell') diff --git a/compiler/Language/Haskell/Syntax/Expr.hs b/compiler/Language/Haskell/Syntax/Expr.hs index e6ce12f8ae..0baaeaa148 100644 --- a/compiler/Language/Haskell/Syntax/Expr.hs +++ b/compiler/Language/Haskell/Syntax/Expr.hs @@ -637,7 +637,7 @@ data HsExpr p -- | - 'GHC.Parser.Annotation.AnnKeywordId' : 'GHC.Parser.Annotation.AnnStatic', -- For details on above see note [exact print annotations] in GHC.Parser.Annotation - | HsStatic (XStatic p) -- Free variables of the body + | HsStatic (XStatic p) -- Free variables of the body, and type after typechecking (LHsExpr p) -- Body --------------------------------------- -- cgit v1.2.1