From a0b08d36a62ce55b8d3d74b47e7846a3ed7a0933 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Wed, 29 Nov 2017 21:18:20 +0100 Subject: [PATCH] Fix #3591: fix paramInfoAsSeenFrom for type lambdas --- compiler/src/dotty/tools/dotc/core/Types.scala | 2 +- tests/pos/i3591.scala | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tests/pos/i3591.scala diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index faa349c911e5..28ca14b7d501 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -3060,7 +3060,7 @@ object Types { def isTypeParam(implicit ctx: Context) = tl.paramNames.head.isTypeName def paramName(implicit ctx: Context) = tl.paramNames(n) def paramInfo(implicit ctx: Context) = tl.paramInfos(n) - def paramInfoAsSeenFrom(pre: Type)(implicit ctx: Context) = paramInfo + def paramInfoAsSeenFrom(pre: Type)(implicit ctx: Context) = paramInfo.asSeenFrom(pre, pre.classSymbol) def paramInfoOrCompleter(implicit ctx: Context): Type = paramInfo def paramVariance(implicit ctx: Context): Int = tl.paramNames(n).variance def paramRef(implicit ctx: Context): Type = tl.paramRefs(n) diff --git a/tests/pos/i3591.scala b/tests/pos/i3591.scala new file mode 100644 index 000000000000..18324eaf23ec --- /dev/null +++ b/tests/pos/i3591.scala @@ -0,0 +1,9 @@ +class Foo { + class A + + type Bla[X <: A] = X +} + +class Bar extends Foo { + val y: Bla[A] = ??? +}