From b69a54f305944aaa9ab0efa59ed5154f04a8cc2f Mon Sep 17 00:00:00 2001 From: Georg Schmid Date: Fri, 2 Feb 2018 16:45:40 +0100 Subject: [PATCH 1/2] Make sure contextual flags are propagated during jvm signature generation --- compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala b/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala index 0086680d69e2..0d3deb3c7100 100644 --- a/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala +++ b/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala @@ -276,7 +276,7 @@ object GenericSignatures { case _ => val etp = erasure(tp) if (etp eq tp) throw new UnknownSig - else jsig(etp) + else jsig(etp, toplevel, primitiveOK) } } val throwsArgs = sym0.annotations flatMap ThrownException.unapply From 63d65f14cc347559b375c7a230644419b22c3124 Mon Sep 17 00:00:00 2001 From: Georg Schmid Date: Fri, 2 Feb 2018 16:48:04 +0100 Subject: [PATCH 2/2] Added test case to check generic signature generation for lists of refined ints --- tests/pos/i3956.scala | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 tests/pos/i3956.scala diff --git a/tests/pos/i3956.scala b/tests/pos/i3956.scala new file mode 100644 index 000000000000..c273fc878053 --- /dev/null +++ b/tests/pos/i3956.scala @@ -0,0 +1,4 @@ +object Foo { + type RInt = Int { val x: Int } + def f(xs: List[Int]): List[RInt] = ??? +} \ No newline at end of file