From e3b49320e7343def793ffe50cb4384e1c34eef70 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 2 Jan 2018 13:35:49 +0100 Subject: [PATCH] Fix #3433: Fix determining typeParams for structural type members --- compiler/src/dotty/tools/dotc/core/TypeApplications.scala | 1 + tests/pos/i3433.scala | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 tests/pos/i3433.scala diff --git a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala index b1c1aeb4db3e..5fef29032fd7 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala @@ -172,6 +172,7 @@ class TypeApplications(val self: Type) extends AnyVal { case self: TypeRef => val tsym = self.symbol if (tsym.isClass) tsym.typeParams + else if (!tsym.exists) self.info.typeParams else if (!tsym.isCompleting) tsym.info.typeParams else Nil case self: AppliedType => diff --git a/tests/pos/i3433.scala b/tests/pos/i3433.scala new file mode 100644 index 000000000000..7c6dbd25bc42 --- /dev/null +++ b/tests/pos/i3433.scala @@ -0,0 +1,4 @@ +object Test { + type Const[t] = { type L[x] = t } + type Bar[a] = Const[Int]#L[a] +}