From 64ae23f6438054a08bebf1fa6af0f14d63cfc0ea Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Thu, 27 Nov 2014 14:27:07 +1000 Subject: SI-9008 Fix regression with higher kinded existentials Allow a naked type constructor in an existential type if we are directly within a type application. Recently, 84d4671 changed nested context creation to avoid passing down the `TypeConstructorAllowed`, which led to missing kind errors in code like `type T[({type M = List})#M]`. However, when typechecking `T forSome { quantifiers }`, we create a nested context to represent the nested scope introduced for the quantifiers. But we need to propagate the `TypeConstructorAllowed` bit to the nested context to allow for higher kinded existentials. The enclosed tests show: - pos/t9008 well kinded application of an hk existential - neg/t9008 hk existential forbidden outside of type application - neg/t9008b kind error reported for hk existential Regressed in 84d4671. --- test/files/neg/t9008.check | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 test/files/neg/t9008.check (limited to 'test/files/neg/t9008.check') diff --git a/test/files/neg/t9008.check b/test/files/neg/t9008.check new file mode 100644 index 0000000000..c32bc41baf --- /dev/null +++ b/test/files/neg/t9008.check @@ -0,0 +1,4 @@ +t9008.scala:2: error: type M takes type parameters + def x: List[M forSome { type M[_] }] = ??? + ^ +one error found -- cgit v1.2.3