diff options
author | Martin Odersky <odersky@gmail.com> | 2015-07-19 12:59:34 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-09-18 18:07:27 +0200 |
commit | 05a4660886276284f966896bc800c8862919c01f (patch) | |
tree | acee6997367f732a235f260d82a9af0f6adcf636 /src/dotty/tools/dotc/core/TypeApplications.scala | |
parent | 31f9da14e5f2357c8af3c106acccc89fdd1f222c (diff) | |
download | dotty-05a4660886276284f966896bc800c8862919c01f.tar.gz dotty-05a4660886276284f966896bc800c8862919c01f.tar.bz2 dotty-05a4660886276284f966896bc800c8862919c01f.zip |
Follow alias types when computing type params.
This aligns typeParams and rawTypeParams. It's not strictly to necessary, though.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeApplications.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/TypeApplications.scala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/TypeApplications.scala b/src/dotty/tools/dotc/core/TypeApplications.scala index c20d52d0d..d0909fed4 100644 --- a/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/src/dotty/tools/dotc/core/TypeApplications.scala @@ -60,9 +60,10 @@ class TypeApplications(val self: Type) extends AnyVal { case tp: TypeRef => val tsym = tp.typeSymbol if (tsym.isClass) tsym.typeParams + else if (tsym.isAliasType) tp.underlying.rawTypeParams else { val lam = LambdaClass(forcing = false) - if (lam.exists) lam.typeParams else Nil//tp.underlying.typeParams + if (lam.exists) lam.typeParams else Nil } case tp: RefinedType => val tparams = tp.parent.typeParams @@ -85,7 +86,7 @@ class TypeApplications(val self: Type) extends AnyVal { * do not remove corresponding type parameters. * Second, it will return Nil for BoundTypes because we might get a NullPointer exception * on PolyParam#underlying otherwise (demonstrated by showClass test). - * Third, it won't return higher-kinded type parameters, i.e. the type parameters of + * Third, it won't return abstract higher-kinded type parameters, i.e. the type parameters of * an abstract type are always empty. */ final def rawTypeParams(implicit ctx: Context): List[TypeSymbol] = { |