From eb0b2886f642ec00b2e7f2db569c25f0e1e34757 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 15 Jul 2015 10:05:20 +0200 Subject: A non-class typeref has type parameters only if subtype of a lambda class. --- src/dotty/tools/dotc/core/TypeApplications.scala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/dotty/tools') diff --git a/src/dotty/tools/dotc/core/TypeApplications.scala b/src/dotty/tools/dotc/core/TypeApplications.scala index 12eeeb674..ca5d93a02 100644 --- a/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/src/dotty/tools/dotc/core/TypeApplications.scala @@ -45,7 +45,7 @@ class TypeApplications(val self: Type) extends AnyVal { /** The type parameters of this type are: * For a ClassInfo type, the type parameters of its class. * For a typeref referring to a class, the type parameters of the class. - * For a typeref referring to an alias or abstract type, the type parameters of + * For a typeref referring to a Lambda class, the type parameters of * its right hand side or upper bound. * For a refinement type, the type parameters of its parent, unless the refinement * re-binds the type parameter with a type-alias. @@ -59,7 +59,10 @@ class TypeApplications(val self: Type) extends AnyVal { case tp: TypeRef => val tsym = tp.typeSymbol if (tsym.isClass) tsym.typeParams - else tp.underlying.typeParams + else { + val lam = LambdaClass(forcing = false) + if (lam.exists) lam.typeParams else Nil//tp.underlying.typeParams + } case tp: RefinedType => val tparams = tp.parent.typeParams tp.refinedInfo match { -- cgit v1.2.3