summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/run/sammy_after_implicit_view.scala20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/files/run/sammy_after_implicit_view.scala b/test/files/run/sammy_after_implicit_view.scala
index 30e3babc75..a13a71e562 100644
--- a/test/files/run/sammy_after_implicit_view.scala
+++ b/test/files/run/sammy_after_implicit_view.scala
@@ -5,24 +5,24 @@ object Test extends App {
final val AnonFunClass = "$anon$"
final val LMFClass = "$$Lambda$" // LambdaMetaFactory names classes like this
- // if there's an implicit conversion, it takes precedence
- def statusQuo() = {
+ // if there's an implicit conversion, it does not takes precedence (because that's what dotty does)
+ def implicitSam() = {
import language.implicitConversions
- var ok = false
- implicit def fun2sam(fun: Int => String): MySam = { ok = true; new MySam { def apply(x: Int) = fun(x) } }
+ var ok = true
+ implicit def fun2sam(fun: Int => String): MySam = { ok = false; new MySam { def apply(x: Int) = fun(x) } }
val className = (((x: Int) => x.toString): MySam).getClass.toString
assert(ok, "implicit conversion not called")
- assert(className contains AnonFunClass, className)
- assert(!(className contains LMFClass), className)
+ assert(!(className contains AnonFunClass), className)
+ assert(className contains LMFClass, className)
}
// indirectly check that this sam type instance was created from a class spun up by LambdaMetaFactory
- def statusIndy() = {
+ def justSammy() = {
val className = (((x: Int) => x.toString): MySam).getClass.toString
assert(!(className contains AnonFunClass), className)
assert(className contains LMFClass, className)
}
- statusQuo()
- statusIndy()
-} \ No newline at end of file
+ implicitSam()
+ justSammy()
+}