diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/UnCurry.scala | 2 | ||||
-rw-r--r-- | test/files/neg/t3653.check | 7 | ||||
-rw-r--r-- | test/files/neg/t3653.scala | 4 |
3 files changed, 13 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala index 8ca3d44afe..8e3722dd99 100644 --- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala +++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala @@ -62,6 +62,8 @@ abstract class UnCurry extends InfoTransform with TypingTransformers { case MethodType(params, ExistentialType(tparams, restpe @ MethodType(_, _))) => assert(false, "unexpected curried method types with intervening existential") tp0 + case MethodType(h :: t, restpe) if h.isImplicit => + apply(MethodType(h.cloneSymbol.resetFlag(IMPLICIT) :: t, restpe)) case PolyType(List(), restpe) => // nullary method type apply(MethodType(List(), restpe)) case PolyType(tparams, restpe) => // polymorphic nullary method type, since it didn't occur in a higher-kinded position diff --git a/test/files/neg/t3653.check b/test/files/neg/t3653.check new file mode 100644 index 0000000000..ac6e2ca9dc --- /dev/null +++ b/test/files/neg/t3653.check @@ -0,0 +1,7 @@ +t3653.scala:3: error: double definition: +method x:(implicit x: Int)Int and +method x:(i: Int)Int at line 2 +have same type after erasure: (x: Int)Int + def x(implicit x: Int) = 5 + ^ +one error found diff --git a/test/files/neg/t3653.scala b/test/files/neg/t3653.scala new file mode 100644 index 0000000000..96cf96008a --- /dev/null +++ b/test/files/neg/t3653.scala @@ -0,0 +1,4 @@ +class B { + def x(i: Int) = 3 + def x(implicit x: Int) = 5 +}
\ No newline at end of file |