diff options
author | Richard Eisenberg <rae@cs.brynmawr.edu> | 2018-07-05 14:21:43 -0400 |
---|---|---|
committer | Richard Eisenberg <rae@cs.brynmawr.edu> | 2018-07-10 19:07:23 -0400 |
commit | 042df603cbb5a77ec13ccfec2ce7bad2bb940aae (patch) | |
tree | dcd4c2290e9f24f9d378a42a1c6eb601de3d0afd /testsuite/tests/polykinds | |
parent | 8ec2946048123f9278cf68eaf520104319a1f569 (diff) | |
download | haskell-042df603cbb5a77ec13ccfec2ce7bad2bb940aae.tar.gz |
Unwrap casts before checking vars in eager unifier
Previously, checking whether (tv |> co) ~ (tv |> co) got deferred,
because we looked for vars before stripping casts. (The left type
would get stripped, and then tv ~ (tv |> co) would scare the occurs-
checker.)
This opportunity for improvement presented itself in other work.
This is just an optimization. Some programs can now report more
errors simultaneously.
Diffstat (limited to 'testsuite/tests/polykinds')
-rw-r--r-- | testsuite/tests/polykinds/T12593.stderr | 59 | ||||
-rw-r--r-- | testsuite/tests/polykinds/T14846.stderr | 25 |
2 files changed, 68 insertions, 16 deletions
diff --git a/testsuite/tests/polykinds/T12593.stderr b/testsuite/tests/polykinds/T12593.stderr index 3e63159057..43f762221e 100644 --- a/testsuite/tests/polykinds/T12593.stderr +++ b/testsuite/tests/polykinds/T12593.stderr @@ -10,7 +10,8 @@ T12593.hs:12:31: error: • Expecting one more argument to ‘k’ Expected a type, but ‘k’ has kind - ‘(((k0 -> k1 -> *) -> Constraint) -> k2 -> *) -> Constraint’ + ‘(((k0 -> k1 -> *) -> Constraint) -> (k2 -> k3 -> *) -> *) + -> Constraint’ • In the kind ‘k’ In the type signature: run :: k2 q => @@ -21,21 +22,65 @@ T12593.hs:12:40: error: • Expecting two more arguments to ‘k1’ Expected a type, but ‘k1’ has kind - ‘((k0 -> k1 -> *) -> Constraint) -> k2 -> *’ + ‘((k0 -> k1 -> *) -> Constraint) -> (k2 -> k3 -> *) -> *’ • In the kind ‘k1’ In the type signature: run :: k2 q => Free k k1 k2 p a b -> (forall (c :: k) (d :: k1). p c d -> q c d) -> q a b -T12593.hs:12:54: error: - • Couldn't match kind ‘((k0 -> k1 -> *) -> Constraint) -> k2 -> *’ +T12593.hs:12:47: error: + • Couldn't match kind ‘(((k0 -> k1 -> *) -> Constraint) + -> (k2 -> k3 -> *) -> *) + -> Constraint’ + with ‘*’ + When matching kinds + k2 :: * + k :: (((k0 -> k1 -> *) -> Constraint) -> (k2 -> k3 -> *) -> *) + -> Constraint + • In the first argument of ‘p’, namely ‘c’ + In the type signature: + run :: k2 q => + Free k k1 k2 p a b + -> (forall (c :: k) (d :: k1). p c d -> q c d) -> q a b + +T12593.hs:12:49: error: + • Couldn't match kind ‘((k0 -> k1 -> *) -> Constraint) + -> (k2 -> k3 -> *) -> *’ + with ‘*’ + When matching kinds + k3 :: * + k4 :: ((k0 -> k1 -> *) -> Constraint) -> (k2 -> k3 -> *) -> * + • In the second argument of ‘p’, namely ‘d’ + In the type signature: + run :: k2 q => + Free k k1 k2 p a b + -> (forall (c :: k) (d :: k1). p c d -> q c d) -> q a b + +T12593.hs:12:56: error: + • Couldn't match kind ‘(((k0 -> k1 -> *) -> Constraint) + -> (k2 -> k3 -> *) -> *) + -> Constraint’ + with ‘*’ + When matching kinds + k0 :: * + k :: (((k0 -> k1 -> *) -> Constraint) -> (k2 -> k3 -> *) -> *) + -> Constraint + • In the first argument of ‘q’, namely ‘c’ + In the type signature: + run :: k2 q => + Free k k1 k2 p a b + -> (forall (c :: k) (d :: k1). p c d -> q c d) -> q a b + +T12593.hs:12:58: error: + • Couldn't match kind ‘((k0 -> k1 -> *) -> Constraint) + -> (k2 -> k3 -> *) -> *’ with ‘*’ When matching kinds - k3 :: ((k0 -> k1 -> *) -> Constraint) -> k2 -> * k1 :: * - Expected kind ‘k -> k3 -> *’, but ‘q’ has kind ‘k0 -> k1 -> *’ - • In the type signature: + k4 :: ((k0 -> k1 -> *) -> Constraint) -> (k2 -> k3 -> *) -> * + • In the second argument of ‘q’, namely ‘d’ + In the type signature: run :: k2 q => Free k k1 k2 p a b -> (forall (c :: k) (d :: k1). p c d -> q c d) -> q a b diff --git a/testsuite/tests/polykinds/T14846.stderr b/testsuite/tests/polykinds/T14846.stderr index 1bfa94218c..3abdb88d2f 100644 --- a/testsuite/tests/polykinds/T14846.stderr +++ b/testsuite/tests/polykinds/T14846.stderr @@ -3,11 +3,11 @@ T14846.hs:38:8: error: • Couldn't match type ‘ríki’ with ‘Hom riki’ ‘ríki’ is a rigid type variable bound by the type signature for: - i :: forall k5 (cls1 :: k5 - -> Constraint) k6 (xx :: k6) (a :: Struct cls1) (ríki :: Struct - cls1 + i :: forall k5 (cls2 :: k5 + -> Constraint) k6 (xx :: k6) (a :: Struct cls2) (ríki :: Struct + cls2 -> Struct - cls1 + cls2 -> *). StructI xx a => ríki a a @@ -30,11 +30,18 @@ T14846.hs:38:8: error: ríki a a In the instance declaration for ‘Category (Hom riki)’ -T14846.hs:39:44: error: - • Expected kind ‘Struct cls0 -> Constraint’, - but ‘cls’ has kind ‘k4 -> Constraint’ - • In the second argument of ‘Structured’, namely ‘cls’ - In the first argument of ‘AStruct’, namely ‘(Structured a cls)’ +T14846.hs:39:31: error: + • Couldn't match kind ‘k4’ with ‘Struct cls0’ + ‘k4’ is a rigid type variable bound by + the instance declaration + at T14846.hs:37:10-65 + When matching kinds + cls :: k4 -> Constraint + cls1 :: Struct cls0 -> Constraint + Expected kind ‘Struct cls1’, + but ‘Structured a cls’ has kind ‘Struct cls’ + • In the first argument of ‘AStruct’, namely ‘(Structured a cls)’ In an expression type signature: AStruct (Structured a cls) + In the expression: struct :: AStruct (Structured a cls) • Relevant bindings include i :: Hom riki a a (bound at T14846.hs:39:3) |