diff options
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/inlineIndyLambdaPrivate.flags | 2 | ||||
-rw-r--r-- | test/files/neg/inlineMaxSize.flags | 2 | ||||
-rw-r--r-- | test/files/neg/missing-arg-list.check | 7 | ||||
-rw-r--r-- | test/files/neg/missing-arg-list.scala | 3 | ||||
-rw-r--r-- | test/files/neg/optimiseDeprecated.check | 2 | ||||
-rw-r--r-- | test/files/neg/partestInvalidFlag.check | 4 | ||||
-rw-r--r-- | test/files/neg/partestInvalidFlag.flags | 2 | ||||
-rw-r--r-- | test/files/neg/sealed-final-neg.flags | 2 | ||||
-rw-r--r-- | test/files/neg/t2712-1.check | 13 | ||||
-rw-r--r-- | test/files/neg/t2712-1.scala | 8 | ||||
-rw-r--r-- | test/files/neg/t2712-2.check | 13 | ||||
-rw-r--r-- | test/files/neg/t2712-2.flags | 1 | ||||
-rw-r--r-- | test/files/neg/t2712-2.scala | 18 | ||||
-rw-r--r-- | test/files/neg/t2712-3.check | 6 | ||||
-rw-r--r-- | test/files/neg/t2712-3.scala | 18 | ||||
-rw-r--r-- | test/files/neg/t2712.flags | 1 |
16 files changed, 94 insertions, 8 deletions
diff --git a/test/files/neg/inlineIndyLambdaPrivate.flags b/test/files/neg/inlineIndyLambdaPrivate.flags index 01b466bd8c..b38f5b8411 100644 --- a/test/files/neg/inlineIndyLambdaPrivate.flags +++ b/test/files/neg/inlineIndyLambdaPrivate.flags @@ -1 +1 @@ --Yopt:l:classpath -Yopt-inline-heuristics:everything -Yopt-warnings:_ -Xfatal-warnings
\ No newline at end of file +-opt:l:classpath -Yopt-inline-heuristics:everything -opt-warnings:_ -Xfatal-warnings
\ No newline at end of file diff --git a/test/files/neg/inlineMaxSize.flags b/test/files/neg/inlineMaxSize.flags index 18b474e797..e765b66af2 100644 --- a/test/files/neg/inlineMaxSize.flags +++ b/test/files/neg/inlineMaxSize.flags @@ -1 +1 @@ --Ydelambdafy:method -Yopt:l:classpath -Yopt-warnings -Xfatal-warnings
\ No newline at end of file +-Ydelambdafy:method -opt:l:classpath -opt-warnings -Xfatal-warnings
\ No newline at end of file diff --git a/test/files/neg/missing-arg-list.check b/test/files/neg/missing-arg-list.check index 5a011c36f2..229baac177 100644 --- a/test/files/neg/missing-arg-list.check +++ b/test/files/neg/missing-arg-list.check @@ -18,4 +18,9 @@ Unapplied methods are only converted to functions when a function type is expect You can make this conversion explicit by writing `h _` or `h(_,_,_)(_)` instead of `h`. val z = h ^ -four errors found +missing-arg-list.scala:15: error: missing argument list for method + in trait T +Unapplied methods are only converted to functions when a function type is expected. +You can make this conversion explicit by writing `+ _` or `+(_)` instead of `+`. + val p = + + ^ +5 errors found diff --git a/test/files/neg/missing-arg-list.scala b/test/files/neg/missing-arg-list.scala index c422dd32fe..44b83e429d 100644 --- a/test/files/neg/missing-arg-list.scala +++ b/test/files/neg/missing-arg-list.scala @@ -10,4 +10,7 @@ trait T { val x = f val y = g val z = h + + def +(i: Int) = i + 42 + val p = + } diff --git a/test/files/neg/optimiseDeprecated.check b/test/files/neg/optimiseDeprecated.check index d51d48f023..16ab3bbf1a 100644 --- a/test/files/neg/optimiseDeprecated.check +++ b/test/files/neg/optimiseDeprecated.check @@ -1,4 +1,4 @@ -warning: -optimise is deprecated: In 2.12, -optimise enables -Yopt:l:classpath. Check -Yopt:help for using the Scala 2.12 optimizer. +warning: -optimise is deprecated: In 2.12, -optimise enables -opt:l:classpath. Check -opt:help for using the Scala 2.12 optimizer. error: No warnings can be incurred under -Xfatal-warnings. one warning found one error found diff --git a/test/files/neg/partestInvalidFlag.check b/test/files/neg/partestInvalidFlag.check index 812191dc22..7a54e3aa43 100644 --- a/test/files/neg/partestInvalidFlag.check +++ b/test/files/neg/partestInvalidFlag.check @@ -1,4 +1,4 @@ error: bad option: '-badCompilerFlag' -error: bad options: -badCompilerFlag notAFlag -Yopt:badChoice -error: flags file may only contain compiler options, found: -badCompilerFlag notAFlag -Yopt:badChoice +error: bad options: -badCompilerFlag notAFlag -opt:badChoice +error: flags file may only contain compiler options, found: -badCompilerFlag notAFlag -opt:badChoice three errors found diff --git a/test/files/neg/partestInvalidFlag.flags b/test/files/neg/partestInvalidFlag.flags index 68884532b9..d45fd31809 100644 --- a/test/files/neg/partestInvalidFlag.flags +++ b/test/files/neg/partestInvalidFlag.flags @@ -1 +1 @@ --badCompilerFlag notAFlag -Yopt:badChoice +-badCompilerFlag notAFlag -opt:badChoice diff --git a/test/files/neg/sealed-final-neg.flags b/test/files/neg/sealed-final-neg.flags index 673aca8931..f2f36c1771 100644 --- a/test/files/neg/sealed-final-neg.flags +++ b/test/files/neg/sealed-final-neg.flags @@ -1 +1 @@ --Xfatal-warnings -Yopt:l:project -Yopt-warnings
\ No newline at end of file +-Xfatal-warnings -opt:l:project -opt-warnings
\ No newline at end of file diff --git a/test/files/neg/t2712-1.check b/test/files/neg/t2712-1.check new file mode 100644 index 0000000000..61e4b6b149 --- /dev/null +++ b/test/files/neg/t2712-1.check @@ -0,0 +1,13 @@ +t2712-1.scala:7: error: no type parameters for method foo: (m: M[A])Unit exist so that it can be applied to arguments (test.Two[Int,String]) + --- because --- +argument expression's type is not compatible with formal parameter type; + found : test.Two[Int,String] + required: ?M[?A] + def test(ma: Two[Int, String]) = foo(ma) // should fail with -Ypartial-unification *disabled* + ^ +t2712-1.scala:7: error: type mismatch; + found : test.Two[Int,String] + required: M[A] + def test(ma: Two[Int, String]) = foo(ma) // should fail with -Ypartial-unification *disabled* + ^ +two errors found diff --git a/test/files/neg/t2712-1.scala b/test/files/neg/t2712-1.scala new file mode 100644 index 0000000000..f7967d71b6 --- /dev/null +++ b/test/files/neg/t2712-1.scala @@ -0,0 +1,8 @@ +package test + +trait Two[A, B] + +object Test { + def foo[M[_], A](m: M[A]) = () + def test(ma: Two[Int, String]) = foo(ma) // should fail with -Ypartial-unification *disabled* +} diff --git a/test/files/neg/t2712-2.check b/test/files/neg/t2712-2.check new file mode 100644 index 0000000000..ea19e33e2c --- /dev/null +++ b/test/files/neg/t2712-2.check @@ -0,0 +1,13 @@ +t2712-2.scala:16: error: type mismatch; + found : test.Foo + required: test.Two[test.X1,Object] +Note: test.X2 <: Object (and test.Foo <: test.Two[test.X1,test.X2]), but trait Two is invariant in type B. +You may wish to define B as +B instead. (SLS 4.5) + test1(foo): One[X3] // fails with -Ypartial-unification enabled + ^ +t2712-2.scala:16: error: type mismatch; + found : test.Two[test.X1,Object] + required: test.One[test.X3] + test1(foo): One[X3] // fails with -Ypartial-unification enabled + ^ +two errors found diff --git a/test/files/neg/t2712-2.flags b/test/files/neg/t2712-2.flags new file mode 100644 index 0000000000..41565c7e32 --- /dev/null +++ b/test/files/neg/t2712-2.flags @@ -0,0 +1 @@ +-Ypartial-unification diff --git a/test/files/neg/t2712-2.scala b/test/files/neg/t2712-2.scala new file mode 100644 index 0000000000..85ed523489 --- /dev/null +++ b/test/files/neg/t2712-2.scala @@ -0,0 +1,18 @@ +package test + +class X1 +class X2 +class X3 + +trait One[A] +trait Two[A, B] + +class Foo extends Two[X1, X2] with One[X3] +object Test { + def test1[M[_], A](x: M[A]): M[A] = x + + val foo = new Foo + + test1(foo): One[X3] // fails with -Ypartial-unification enabled + test1(foo): Two[X1, X2] // fails without -Ypartial-unification +} diff --git a/test/files/neg/t2712-3.check b/test/files/neg/t2712-3.check new file mode 100644 index 0000000000..a84d96bf09 --- /dev/null +++ b/test/files/neg/t2712-3.check @@ -0,0 +1,6 @@ +t2712-3.scala:17: error: type mismatch; + found : test.One[test.X3] + required: test.Two[test.X1,test.X2] + test1(foo): Two[X1, X2] // fails without -Ypartial-unification + ^ +one error found diff --git a/test/files/neg/t2712-3.scala b/test/files/neg/t2712-3.scala new file mode 100644 index 0000000000..85ed523489 --- /dev/null +++ b/test/files/neg/t2712-3.scala @@ -0,0 +1,18 @@ +package test + +class X1 +class X2 +class X3 + +trait One[A] +trait Two[A, B] + +class Foo extends Two[X1, X2] with One[X3] +object Test { + def test1[M[_], A](x: M[A]): M[A] = x + + val foo = new Foo + + test1(foo): One[X3] // fails with -Ypartial-unification enabled + test1(foo): Two[X1, X2] // fails without -Ypartial-unification +} diff --git a/test/files/neg/t2712.flags b/test/files/neg/t2712.flags new file mode 100644 index 0000000000..41565c7e32 --- /dev/null +++ b/test/files/neg/t2712.flags @@ -0,0 +1 @@ +-Ypartial-unification |