diff options
author | Martin Odersky <odersky@gmail.com> | 2015-07-15 10:05:20 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-09-18 18:07:27 +0200 |
commit | eb0b2886f642ec00b2e7f2db569c25f0e1e34757 (patch) | |
tree | ca55d34c4150fc366f5c80e94f73267a0551f98a /src | |
parent | 525e0ac7bcb35eb78fedd4a943ef07106752f9fb (diff) | |
download | dotty-eb0b2886f642ec00b2e7f2db569c25f0e1e34757.tar.gz dotty-eb0b2886f642ec00b2e7f2db569c25f0e1e34757.tar.bz2 dotty-eb0b2886f642ec00b2e7f2db569c25f0e1e34757.zip |
A non-class typeref has type parameters only if subtype of a lambda class.
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/core/TypeApplications.scala | 7 |
1 files changed, 5 insertions, 2 deletions
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 { |