[Git][ghc/ghc][wip/9.14.2-backports] 2 commits: fixup! Add a deprecation warning for static forms
Zubin pushed to branch wip/9.14.2-backports at Glasgow Haskell Compiler / GHC Commits: 5958b71b by Zubin Duggal at 2026-06-10T16:40:02+05:30 fixup! Add a deprecation warning for static forms - - - - - 2b08ab0b by Zubin Duggal at 2026-06-10T16:40:08+05:30 fixup! QuickLook's tcInstFun should make instantiation variables directly - - - - - 7 changed files: - testsuite/tests/codeGen/should_run/CgStaticPointers.hs - testsuite/tests/codeGen/should_run/CgStaticPointersNoFullLazyness.hs - testsuite/tests/default/default-fail05.stderr - testsuite/tests/indexed-types/should_fail/T1897b.stderr - testsuite/tests/rename/should_fail/RnStaticPointersFail01.stderr - testsuite/tests/rename/should_fail/RnStaticPointersFail03.stderr - testsuite/tests/rep-poly/RepPolyRightSection.stderr Changes: ===================================== testsuite/tests/codeGen/should_run/CgStaticPointers.hs ===================================== @@ -15,9 +15,9 @@ main = do print $ deRefStaticPtr (static g) print $ deRefStaticPtr p0 'a' print $ deRefStaticPtr (static t_field) $ T 'b' - where - g :: String - g = "found" + +g :: String +g = "found" lookupKey :: StaticPtr a -> IO a lookupKey p = unsafeLookupStaticPtr (staticKey p) >>= \case ===================================== testsuite/tests/codeGen/should_run/CgStaticPointersNoFullLazyness.hs ===================================== @@ -15,9 +15,9 @@ main = do print $ deRefStaticPtr (static g) print $ deRefStaticPtr p0 'a' print $ deRefStaticPtr (static t_field) $ T 'b' - where - g :: String - g = "found" + +g :: String +g = "found" lookupKey :: StaticPtr a -> IO a lookupKey p = unsafeLookupStaticPtr (staticKey p) >>= \case ===================================== testsuite/tests/default/default-fail05.stderr ===================================== @@ -1,7 +1,7 @@ default-fail05.hs:11:10: error: [GHC-39999] - • Ambiguous type variable ‘t0’ arising from a use of ‘toList’ - prevents the constraint ‘(Foldable t0)’ from being solved. - Probable fix: use a type annotation to specify what ‘t0’ should be. + • Ambiguous type variable ‘f0’ arising from a use of ‘toList’ + prevents the constraint ‘(Foldable f0)’ from being solved. + Probable fix: use a type annotation to specify what ‘f0’ should be. Potentially matching instances: instance Foldable (Either a) -- Defined in ‘GHC.Internal.Data.Foldable’ @@ -14,9 +14,9 @@ default-fail05.hs:11:10: error: [GHC-39999] In a stmt of a 'do' block: print (toList $ pure 21) default-fail05.hs:11:19: error: [GHC-39999] - • Ambiguous type variable ‘t0’ arising from a use of ‘pure’ - prevents the constraint ‘(Applicative t0)’ from being solved. - Probable fix: use a type annotation to specify what ‘t0’ should be. + • Ambiguous type variable ‘f0’ arising from a use of ‘pure’ + prevents the constraint ‘(Applicative f0)’ from being solved. + Probable fix: use a type annotation to specify what ‘f0’ should be. Potentially matching instances: instance Applicative IO -- Defined in ‘GHC.Internal.Base’ instance Applicative Maybe -- Defined in ‘GHC.Internal.Base’ @@ -28,11 +28,11 @@ default-fail05.hs:11:19: error: [GHC-39999] In a stmt of a 'do' block: print (toList $ pure 21) default-fail05.hs:12:3: error: [GHC-39999] - • Ambiguous type variable ‘t1’ arising from a use of ‘traverse’ - prevents the constraint ‘(Traversable t1)’ from being solved. + • Ambiguous type variable ‘t0’ arising from a use of ‘traverse’ + prevents the constraint ‘(Traversable t0)’ from being solved. Relevant bindings include - main :: IO (t1 ()) (bound at default-fail05.hs:10:1) - Probable fix: use a type annotation to specify what ‘t1’ should be. + main :: IO (t0 ()) (bound at default-fail05.hs:10:1) + Probable fix: use a type annotation to specify what ‘t0’ should be. Potentially matching instances: instance Traversable (Either a) -- Defined in ‘GHC.Internal.Data.Traversable’ @@ -51,11 +51,11 @@ default-fail05.hs:12:3: error: [GHC-39999] traverse print (pure 42) default-fail05.hs:12:19: error: [GHC-39999] - • Ambiguous type variable ‘t1’ arising from a use of ‘pure’ - prevents the constraint ‘(Applicative t1)’ from being solved. + • Ambiguous type variable ‘t0’ arising from a use of ‘pure’ + prevents the constraint ‘(Applicative t0)’ from being solved. Relevant bindings include - main :: IO (t1 ()) (bound at default-fail05.hs:10:1) - Probable fix: use a type annotation to specify what ‘t1’ should be. + main :: IO (t0 ()) (bound at default-fail05.hs:10:1) + Probable fix: use a type annotation to specify what ‘t0’ should be. Potentially matching instances: instance Applicative IO -- Defined in ‘GHC.Internal.Base’ instance Applicative Maybe -- Defined in ‘GHC.Internal.Base’ ===================================== testsuite/tests/indexed-types/should_fail/T1897b.stderr ===================================== @@ -1,14 +1,14 @@ T1897b.hs:16:1: error: [GHC-83865] - • Couldn't match type: Depend a0 - with: Depend a - Expected: t (Depend a) -> Bool - Actual: t (Depend a0) -> Bool + • Couldn't match type: Depend b0 + with: Depend b + Expected: t (Depend b) -> Bool + Actual: t (Depend b0) -> Bool Note: ‘Depend’ is a non-injective type family. - The type variable ‘a0’ is ambiguous + The type variable ‘b0’ is ambiguous • In the ambiguity check for the inferred type for ‘isValid’ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes When checking the inferred type - isValid :: forall {t :: * -> *} {a}. - (Foldable t, Bug a) => - t (Depend a) -> Bool + isValid :: forall {t :: * -> *} {b}. + (Foldable t, Bug b) => + t (Depend b) -> Bool ===================================== testsuite/tests/rename/should_fail/RnStaticPointersFail01.stderr ===================================== @@ -1,6 +1,5 @@ +RnStaticPointersFail01.hs:5:7: error: [GHC-82529] + From GHC 9.16, static forms cannot mention nested let-bound variables + Offending variables: x + Solution: move these free variables to top level -RnStaticPointersFail01.hs:5:7: error: [GHC-88431] - • ‘x’ is used in a static form but it is not closed because it - is not let-bound. - • In the expression: static x - In an equation for ‘f’: f x = static x ===================================== testsuite/tests/rename/should_fail/RnStaticPointersFail03.stderr ===================================== @@ -1,29 +1,20 @@ +RnStaticPointersFail03.hs:8:7: error: [GHC-82529] + From GHC 9.16, static forms cannot mention nested let-bound variables + Offending variables: x + Solution: move these free variables to top level -RnStaticPointersFail03.hs:8:7: error: [GHC-88431] - • ‘x’ is used in a static form but it is not closed because it - is not let-bound. - • In the expression: static (x . id) - In an equation for ‘f’: f x = static (x . id) +RnStaticPointersFail03.hs:10:8: error: [GHC-82529] + From GHC 9.16, static forms cannot mention nested let-bound variables + Offending variables: k + Solution: move these free variables to top level -RnStaticPointersFail03.hs:10:8: error: [GHC-88431] - • ‘k’ is used in a static form but it is not closed because it - uses ‘x’ which is not let-bound. - • In the expression: static (k . id) - In an equation for ‘f0’: - f0 x - = static (k . id) - where - k = const (const () x) +RnStaticPointersFail03.hs:14:8: error: [GHC-82529] + From GHC 9.16, static forms cannot mention nested let-bound variables + Offending variables: k + Solution: move these free variables to top level + +RnStaticPointersFail03.hs:19:15: error: [GHC-82529] + From GHC 9.16, static forms cannot mention nested let-bound variables + Offending variables: g + Solution: move these free variables to top level -RnStaticPointersFail03.hs:19:15: error: [GHC-88431] - • ‘g’ is used in a static form but it is not closed because it - uses ‘h’ which has a non-closed type because it contains the - type variables: ‘a’ - • In the first argument of ‘const’, namely ‘(static (g undefined))’ - In the expression: const (static (g undefined)) (h x) - In an equation for ‘f2’: - f2 x - = const (static (g undefined)) (h x) - where - g = h - h = typeOf ===================================== testsuite/tests/rep-poly/RepPolyRightSection.stderr ===================================== @@ -8,6 +8,7 @@ RepPolyRightSection.hs:14:11: error: [GHC-55287] • * Cannot unify ‘r’ with the type variable ‘q0’ because the former is not a concrete ‘RuntimeRep’. - • In the expression: `g` undefined + • In the expression: g + In the expression: `g` undefined In an equation for ‘test2’: test2 = (`g` undefined) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a4d4588bc494a7c84d498b17d815c20... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a4d4588bc494a7c84d498b17d815c20... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Zubin (@wz1000)