Skip to content

Commit d929fc9

Browse files
authored
Merge pull request #3601 from dotty-staging/fix-paramInfoAsSeenFrom
Fix #3591: fix paramInfoAsSeenFrom for type lambdas
2 parents 19fdc50 + a0b08d3 commit d929fc9

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3060,7 +3060,7 @@ object Types {
30603060
def isTypeParam(implicit ctx: Context) = tl.paramNames.head.isTypeName
30613061
def paramName(implicit ctx: Context) = tl.paramNames(n)
30623062
def paramInfo(implicit ctx: Context) = tl.paramInfos(n)
3063-
def paramInfoAsSeenFrom(pre: Type)(implicit ctx: Context) = paramInfo
3063+
def paramInfoAsSeenFrom(pre: Type)(implicit ctx: Context) = paramInfo.asSeenFrom(pre, pre.classSymbol)
30643064
def paramInfoOrCompleter(implicit ctx: Context): Type = paramInfo
30653065
def paramVariance(implicit ctx: Context): Int = tl.paramNames(n).variance
30663066
def paramRef(implicit ctx: Context): Type = tl.paramRefs(n)

tests/pos/i3591.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Foo {
2+
class A
3+
4+
type Bla[X <: A] = X
5+
}
6+
7+
class Bar extends Foo {
8+
val y: Bla[A] = ???
9+
}

0 commit comments

Comments
 (0)