From a550db3a846f1bfdc2cdc76436154d74fb2bbaf0 Mon Sep 17 00:00:00 2001 From: Martin Duhem Date: Mon, 27 Nov 2017 10:25:37 +0100 Subject: [PATCH] Fix #3553: Wrong generic sig. with singleton types --- .../dotty/tools/dotc/transform/GenericSignatures.scala | 2 +- tests/pos/i3553.scala | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tests/pos/i3553.scala diff --git a/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala b/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala index e95815cc0e5b..fcbfc6387a6a 100644 --- a/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala +++ b/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala @@ -56,7 +56,7 @@ object GenericSignatures { ps.foreach(boxedSig) } - def boxedSig(tp: Type): Unit = jsig(tp, primitiveOK = false) + def boxedSig(tp: Type): Unit = jsig(tp.widenDealias, primitiveOK = false) def boundsSig(bounds: List[Type]): Unit = { val (isTrait, isClass) = bounds partition (_.typeSymbol.is(Trait)) diff --git a/tests/pos/i3553.scala b/tests/pos/i3553.scala new file mode 100644 index 000000000000..a756f86f3d56 --- /dev/null +++ b/tests/pos/i3553.scala @@ -0,0 +1,8 @@ +class Foo[T <: List[1]](param: List[1]) { + def foo(in: List[1]): List[true] = Nil + def bar[U >: List[1]](in: List['z']): List[1.0e9] = Nil +} +class Bar[T <: 1](param: 1) { + def foo(in: 1): true = true + def bar[U >: 1](in: 'z'): 1.0e9 = 1.0e9 +} \ No newline at end of file