[Git][ghc/ghc][wip/T23162-spj] Comments only [skip ci]
Simon Peyton Jones pushed to branch wip/T23162-spj at Glasgow Haskell Compiler / GHC Commits: 848e1dcb by Simon Peyton Jones at 2025-07-16T22:55:31+01:00 Comments only [skip ci] - - - - - 2 changed files: - compiler/GHC/Tc/Solver/FunDeps.hs - testsuite/tests/typecheck/should_compile/tc126.hs Changes: ===================================== compiler/GHC/Tc/Solver/FunDeps.hs ===================================== @@ -256,12 +256,12 @@ Consider T4254b: From the ambiguity check on the type signature we get [G] FD Int b [W] FD Int beta - If we ineract that Wanted with /both/ the t0p-level instance, /and/ the + If we interact that Wanted with /both/ the top-level instance, /and/ the local Given, we'll get beta ~ Int and beta ~ b respectively. That would generate (b~Bool), which would fai. I think it doesn't matter which of the two we pick, but historically we have - picked teh local-fundeps firs. + picked the local-fundeps first. (DFL2) Try solving from top-level instances before fundeps. From the definition `foo = op` we get ===================================== testsuite/tests/typecheck/should_compile/tc126.hs ===================================== @@ -35,3 +35,50 @@ g2 = f (f (f [0::Int])) -- The outer f repeats the exercise, so g2::Int -- This is the definition that Hugs rejects + +{- +start iteration=0 + [W] $dBug_aET {0} :: Bug (Int -> Int) a_aER[tau:1] r_aES[tau:1] (CDictCan) + [W] $dBug_aEW {0} :: Bug (Int -> Int) [r_aFd[tau:1]] a_aER[tau:1] (CDictCan) + [W] $dBug_aF0 {0} :: Bug (Int -> Int) [Int] [r_aFd[tau:1]] (CDictCan)} +--> + [W] $dBug_aET {0} :: Bug (Int -> Int) a_aER[tau:1] r_aES[tau:1] (CDictCan) + [W] $dBug_aEW {0} :: Bug (Int -> Int) [r_aFd[tau:1]] a_aER[tau:1] (CDictCan) + [W] $dBug_aF0 {0} :: Bug (Int -> Int) Int r_aFd[tau:1] (CDictCan)} +--> fds + a_aER := [r_aFf] + r_fD := Int + +start iteration=1 + [W] $dBug_aET {0} :: Bug (Int -> Int) [r_aFf[tau:1]] r_aES[tau:1] (CDictCan) + [W] $dBug_aEW {0} :: Bug (Int -> Int) [r_aFd[tau:1]] [r_aFf][tau:1]] (CDictCan) + [W] $dBug_aF0 {0} :: Bug (Int -> Int) Int Int (CDictCan)} +--> (solve aF0, instance for aEW) + [W] $dBug_aET {0} :: Bug (Int -> Int) [r_aFf[tau:1]] r_aES[tau:1] (CDictCan) + [W] $dBug_aFg {1} :: Bug (Int -> Int) Int r_aFf[tau:1] (CDictCan)} +--> fds + r_aES := [r_aFh] -- fresh r_aFh + r_aFf := Int + +start iteration=2 + [W] $dBug_aET {0} :: Bug (Int -> Int) [Int] [r_afH[tau:1]] (CDictCan) + [W] $dBug_aFg {1} :: Bug (Int -> Int) Int Int (CDictCan)} +--> (solve afG instance for aET + [W] $dBug_aFi {1} :: Bug (Int -> Int) Int r_aFh[tau:1] (CDictCan)} +--> fds + f_afH := Int + +start iteration 3 + [W] $dBug_aFi {1} :: Bug (Int -> Int) Int Int (CDictCan)} +--> solve + + + + [W] $dBug_aCv {0} :: Bug (Int -> Int) [r_aCL[tau:1]] r_aCu[tau:1] (CDictCan) + [W] $dBug_aEI {1} :: Bug (Int -> Int) Int r_aCL[tau:1] (CDictCan)} +--> + r_aCL := Int + r_aCu := [ r_new ] -- r_aEJ + + [W] Bug (Int -> Int) Int r_new +-} View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/848e1dcbd1e191f70c411c0697cc5a61... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/848e1dcbd1e191f70c411c0697cc5a61... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Simon Peyton Jones (@simonpj)