From a89000be9f5b6506bcd891bd076700a9d1e79d01 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Mon, 2 Dec 2013 17:14:41 +0100 Subject: SI-8023 Fix symbol-completion-order type var pattern bug Removing the `isComplete` check altogether leads to cycles in, for instatnce, F-bound type parameters: trait LSO[+A, +Repr <: LSO[A, Repr]] // error: illegal cyclic reference involving type Repr But, I believe that we can (and must) eagerly initialize the type parameter symbols if we are typechecking a pattern. While this appeared to regress in 2.11.x, but the problem was in fact dormant and was merely uncovered in the fix for SI-7756, 3df1d77fc. --- test/files/pos/t8023.scala | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/files/pos/t8023.scala (limited to 'test/files') diff --git a/test/files/pos/t8023.scala b/test/files/pos/t8023.scala new file mode 100644 index 0000000000..86824084ed --- /dev/null +++ b/test/files/pos/t8023.scala @@ -0,0 +1,22 @@ +import language._ + + +object Test { + def foo = (null: Any) match { + case a: A[k] => + // error: kinds of the type arguments (k) do not conform to the + // expected kinds of the type parameters (type K) in class B. + new B[k]() + } +} + +class A[K[L[_]]] + +class B[K[M[_]]] + + +object Test2 { + def foo = (null: Any) match { + case a: A[k] => new B[k]() // this one worked before as the info of `A` was complete + } +} -- cgit v1.2.3