From bd4bfface0581041d27c5d243723e39dd99c28fc Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Wed, 9 Jan 2013 14:44:47 -0800 Subject: SI-5189 detect unsoundness when inferring type of match GADT skolems encode type slack that results from pattern matching on variant type constructors I thought they would not longer be relevant after cases have been typed, and since they caused weird issues with the old pattern matcher, I deskolemized in typedCase however, when we don't have an expected type for the match, we need to keep the skolems around until the skolemized type makes it out of the match and it becomes the result of type inference for that match when you do have an expected type, it will propagate to the case-level and the confrontation will thus already take place when typing individual cases --- test/files/neg/t5189_inferred.check | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 test/files/neg/t5189_inferred.check (limited to 'test/files/neg/t5189_inferred.check') diff --git a/test/files/neg/t5189_inferred.check b/test/files/neg/t5189_inferred.check new file mode 100644 index 0000000000..9cc5dcc242 --- /dev/null +++ b/test/files/neg/t5189_inferred.check @@ -0,0 +1,6 @@ +t5189_inferred.scala:7: error: type mismatch; + found : scala.collection.immutable.Nil.type + required: ?A1 where type ?A1 + f(Invariant(arr): Covariant[Any])(0) = Nil + ^ +one error found -- cgit v1.2.3