Skip to content

Commit 8558b4d

Browse files
authored
Merge pull request #3563 from Duhemm/fix/3553
Fix #3553: Wrong generic sig. with singleton types
2 parents 780183d + a550db3 commit 8558b4d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ object GenericSignatures {
5656
ps.foreach(boxedSig)
5757
}
5858

59-
def boxedSig(tp: Type): Unit = jsig(tp, primitiveOK = false)
59+
def boxedSig(tp: Type): Unit = jsig(tp.widenDealias, primitiveOK = false)
6060

6161
def boundsSig(bounds: List[Type]): Unit = {
6262
val (isTrait, isClass) = bounds partition (_.typeSymbol.is(Trait))

tests/pos/i3553.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Foo[T <: List[1]](param: List[1]) {
2+
def foo(in: List[1]): List[true] = Nil
3+
def bar[U >: List[1]](in: List['z']): List[1.0e9] = Nil
4+
}
5+
class Bar[T <: 1](param: 1) {
6+
def foo(in: 1): true = true
7+
def bar[U >: 1](in: 'z'): 1.0e9 = 1.0e9
8+
}

0 commit comments

Comments
 (0)