diff options
author | Martin Odersky <odersky@gmail.com> | 2014-01-03 12:56:11 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-01-03 12:56:11 +0100 |
commit | 2d500b7746a38647c7a97db99207ca4972cd49eb (patch) | |
tree | 42cb547bbb037b04636dff12904330ab58f01daa /src/dotty/tools/dotc/core/TypeApplications.scala | |
parent | 9955a2fd64af1ff7b9992fa12662a85e07d82fc7 (diff) | |
download | dotty-2d500b7746a38647c7a97db99207ca4972cd49eb.tar.gz dotty-2d500b7746a38647c7a97db99207ca4972cd49eb.tar.bz2 dotty-2d500b7746a38647c7a97db99207ca4972cd49eb.zip |
safeUnderlyingTypeParams now forces uncompleted symbols.
When removing logging, it turned out that Coder no longer compiled. The problem was tracked to safeUnderlyingTypeParams which did not force enough.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeApplications.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/TypeApplications.scala | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/dotty/tools/dotc/core/TypeApplications.scala b/src/dotty/tools/dotc/core/TypeApplications.scala index 4080d74dc..9e5c3d5a5 100644 --- a/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/src/dotty/tools/dotc/core/TypeApplications.scala @@ -51,23 +51,21 @@ class TypeApplications(val self: Type) extends AnyVal { } } /** The type parameters of the underlying class. - * This is like `typeParams`, except for 4 differences. + * This is like `typeParams`, except for 3 differences. * First, it does not adjust type parameters in refined types. I.e. type arguments * do not remove corresponding type parameters. - * Second, it will return Nil instead of forcing a symbol, in order to rule - * out CyclicReference exceptions. - * Third, it will return Nil for BoundTypes because we might get a NullPointer exception + * Second, it will return Nil for BoundTypes because we might get a NullPointer exception * on PolyParam#underlying otherwise (demonstrated by showClass test). - * Fourth, it won't return higher-kinded type parameters. + * Third, it won't return higher-kinded type parameters. */ final def safeUnderlyingTypeParams(implicit ctx: Context): List[TypeSymbol] = { def ifCompleted(sym: Symbol): Symbol = if (sym.isCompleted) sym else NoSymbol self match { case tp: ClassInfo => - if (tp.cls.isCompleted) tp.cls.typeParams else Nil + tp.cls.typeParams case tp: TypeRef => val tsym = tp.typeSymbol - if (tsym.isClass && tsym.isCompleted) tsym.typeParams + if (tsym.isClass) tsym.typeParams else if (tsym.isAliasType) tp.underlying.safeUnderlyingTypeParams else Nil case tp: BoundType => |