diff options
author | Paul Phillips <paulp@improving.org> | 2011-11-07 08:54:57 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-11-07 08:54:57 +0000 |
commit | c8683ff5bfd247972ba929496142d45e31c01ca5 (patch) | |
tree | 425c822eda643e2611c5c142f492a48c44390729 /test/files/neg | |
parent | d6f9361e4bf9ee8615d1a700963535f82580ca0d (diff) | |
download | scala-c8683ff5bfd247972ba929496142d45e31c01ca5.tar.gz scala-c8683ff5bfd247972ba929496142d45e31c01ca5.tar.bz2 scala-c8683ff5bfd247972ba929496142d45e31c01ca5.zip |
Fix crash with HK types.
Another page in the storied history of "call .tpe when one should have
called .tpeHK", in this case leading to a crash of stacktraciness.
Closes SI-5152, review by moors.
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t5152.check | 9 | ||||
-rw-r--r-- | test/files/neg/t5152.scala | 17 |
2 files changed, 26 insertions, 0 deletions
diff --git a/test/files/neg/t5152.check b/test/files/neg/t5152.check new file mode 100644 index 0000000000..80e0141b64 --- /dev/null +++ b/test/files/neg/t5152.check @@ -0,0 +1,9 @@ +t5152.scala:7: error: kinds of the type arguments (Test.B) do not conform to the expected kinds of the type parameters (type E) in class A. +Test.B's type parameters do not match type E's expected parameters: type E has one type parameter, but type _ has none + class B[E[_]] extends A[B] { } // B is depth 2 but A requires 1 + ^ +t5152.scala:11: error: kinds of the type arguments (Test.B1) do not conform to the expected kinds of the type parameters (type E) in class A1. +Test.B1's type parameters do not match type E's expected parameters: type _ has no type parameters, but type G has one + class B1[E[_]] extends A1[B1] // B1 is depth 2 but A1 requires 3 + ^ +two errors found diff --git a/test/files/neg/t5152.scala b/test/files/neg/t5152.scala new file mode 100644 index 0000000000..5efc76af24 --- /dev/null +++ b/test/files/neg/t5152.scala @@ -0,0 +1,17 @@ +object Test { + new C + new C1 + new C2 + + class A[E[_]] { } + class B[E[_]] extends A[B] { } // B is depth 2 but A requires 1 + class C extends B { } + + class A1[E[F[G[_]]]] { } + class B1[E[_]] extends A1[B1] // B1 is depth 2 but A1 requires 3 + class C1 extends B1 { } + + class A2[E[_]] { } + class B2[E] extends A2[B2] { } // this one is correct + class C2 extends B2 { } +} |