From 35d0acdad24717c1843304fd5eb124313658e7d2 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 11 Apr 2017 17:07:08 +0200 Subject: Add fullyDefinedType for class parent types If we do not do that, any type variables in the parent type get interpolated later, when the whole primary constructor is typed. But by then we miss the context of what their variance was. --- tests/pos/i2218.scala | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/pos/i2218.scala (limited to 'tests') diff --git a/tests/pos/i2218.scala b/tests/pos/i2218.scala new file mode 100644 index 000000000..fbede8b9b --- /dev/null +++ b/tests/pos/i2218.scala @@ -0,0 +1,9 @@ +trait Rule[In] + +class C { + def ruleWithName[In](f: In => Int): Rule[In] = { + new DefaultRule(f) {} + } + + class DefaultRule[In](f: In => Int) extends Rule[In] +} -- cgit v1.2.3