diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-04-23 13:38:55 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-04-23 13:38:55 +0200 |
commit | c01389d170bb0f1c8a925a25c145396007a75106 (patch) | |
tree | 40d0117154755585d1208ef28c67d11bffe6b238 /tests/pos | |
parent | e3449e9fdbb3801eb07680e4938bc4c3c77ec3a8 (diff) | |
download | dotty-c01389d170bb0f1c8a925a25c145396007a75106.tar.gz dotty-c01389d170bb0f1c8a925a25c145396007a75106.tar.bz2 dotty-c01389d170bb0f1c8a925a25c145396007a75106.zip |
Fix #492. Traits that require an outer pointer are not SAMs.
Diffstat (limited to 'tests/pos')
-rw-r--r-- | tests/pos/sammy_poly.scala | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/pos/sammy_poly.scala b/tests/pos/sammy_poly.scala index f43fa292c..ff20b5c9c 100644 --- a/tests/pos/sammy_poly.scala +++ b/tests/pos/sammy_poly.scala @@ -1,7 +1,13 @@ // test synthesizeSAMFunction where the sam type is not fully defined + +trait F1[T, U] { def apply(x: T): U } class T { - trait F[T, U] { def apply(x: T): U } // NOTE: the f(x) desugaring for now assumes the single abstract method is called 'apply' - def app[T, U](x: T)(f: F[T, U]): U = f(x) - app(1)(x => List(x)) + def app1[T, U](x: T)(f: F1[T, U]): U = f(x) + def app2[T, U](x: T)(f: F2[T, U]): U = f(x) + app1(1)(x => List(x)) + app2(1)(x => List(x)) +} +object T{ + trait F2[T, U] { def apply(x: T): U } } |