diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/sammy_restrictions.check | 5 | ||||
-rw-r--r-- | test/files/neg/sammy_restrictions.scala | 2 | ||||
-rw-r--r-- | test/files/pos/sammy_implicit.scala | 2 | ||||
-rw-r--r-- | test/files/pos/sammy_poly.scala | 3 | ||||
-rw-r--r-- | test/files/run/indylambda-boxing/test.scala | 7 |
5 files changed, 9 insertions, 10 deletions
diff --git a/test/files/neg/sammy_restrictions.check b/test/files/neg/sammy_restrictions.check index 8cc49f9aa9..0276f3a067 100644 --- a/test/files/neg/sammy_restrictions.check +++ b/test/files/neg/sammy_restrictions.check @@ -8,9 +8,6 @@ sammy_restrictions.scala:32: error: type mismatch; required: TwoAbstract ((x: Int) => 0): TwoAbstract ^ -sammy_restrictions.scala:34: error: class type required but DerivedOneAbstract with OneAbstract found - ((x: Int) => 0): NonClassType // "class type required". I think we should avoid SAM translation here. - ^ sammy_restrictions.scala:35: error: type mismatch; found : Int => Int required: NoEmptyConstructor @@ -46,4 +43,4 @@ sammy_restrictions.scala:44: error: type mismatch; required: PolyMethod ((x: Int) => 0): PolyMethod ^ -10 errors found +9 errors found diff --git a/test/files/neg/sammy_restrictions.scala b/test/files/neg/sammy_restrictions.scala index d003cfaf36..101342ad0b 100644 --- a/test/files/neg/sammy_restrictions.scala +++ b/test/files/neg/sammy_restrictions.scala @@ -31,7 +31,7 @@ object Test { (() => 0) : NoAbstract ((x: Int) => 0): TwoAbstract ((x: Int) => 0): DerivedOneAbstract // okay - ((x: Int) => 0): NonClassType // "class type required". I think we should avoid SAM translation here. + ((x: Int) => 0): NonClassType // okay -- we also allow type aliases in instantiation expressions, if they resolve to a class type ((x: Int) => 0): NoEmptyConstructor ((x: Int) => 0): OneEmptyConstructor // okay ((x: Int) => 0): OneEmptySecondaryConstructor // derived class must have an empty *primary* to call. diff --git a/test/files/pos/sammy_implicit.scala b/test/files/pos/sammy_implicit.scala index c9c2519bab..e4b82df4cc 100644 --- a/test/files/pos/sammy_implicit.scala +++ b/test/files/pos/sammy_implicit.scala @@ -6,5 +6,5 @@ abstract class SamImplicitConvert { implicit def conv(xs: Array[Int]): Lst[Int] - val encoded = flatMap (_.getBytes) + def encoded = flatMap (_.getBytes) } diff --git a/test/files/pos/sammy_poly.scala b/test/files/pos/sammy_poly.scala index c629be7166..75ee36f654 100644 --- a/test/files/pos/sammy_poly.scala +++ b/test/files/pos/sammy_poly.scala @@ -1,7 +1,8 @@ // test synthesizeSAMFunction where the sam type is not fully defined class T { trait F[T, U] { def apply(x: T): U } +// type F[T, U] = 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)) -}
\ No newline at end of file +} diff --git a/test/files/run/indylambda-boxing/test.scala b/test/files/run/indylambda-boxing/test.scala index cc0a460640..82f8d2f497 100644 --- a/test/files/run/indylambda-boxing/test.scala +++ b/test/files/run/indylambda-boxing/test.scala @@ -2,15 +2,16 @@ class Capture class Test { def test1 = (i: Int) => "" def test2 = (i: VC) => i - def test3 = (i: Int) => i + def test3 = (i: Int) => i // not adapted, specialized - def test4 = {val c = new Capture; (i: Int) => {(c, Test.this.toString); 42} } + def test4 = {val c = new Capture; (i: Int) => {(c, Test.this.toString); 42} } // not adapted, specialized def test5 = {val c = new Capture; (i: VC) => (c, Test.this.toString) } def test6 = {val c = new Capture; (i: Int) => (c, Test.this.toString) } def test7 = {val vc = new Capture; (i: Int) => vc } - def test8 = {val c = 42; (s: String) => (s, c)} + def test8 = {val c = 42; (s: String) => (s, c)} // not adapted def test9 = {val c = 42; (s: String) => ()} + def test10 = {(s: List[String]) => ()} } object Test { |