diff options
author | Som Snytt <som.snytt@gmail.com> | 2014-07-20 14:48:33 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2014-07-20 15:14:35 -0700 |
commit | 01da58e6b6d356e7830183806056e27f70099caf (patch) | |
tree | 2439397b600fc6876ef4e7c709e81dae9a02061d /test/files/pos | |
parent | abdd570cee5788000724c6d3b89a978c48a7fa39 (diff) | |
download | scala-01da58e6b6d356e7830183806056e27f70099caf.tar.gz scala-01da58e6b6d356e7830183806056e27f70099caf.tar.bz2 scala-01da58e6b6d356e7830183806056e27f70099caf.zip |
SI-8736 Restore -language to former glory
MultiChoice allows -language to work like -Xlint.
The bug as described was that the setting value was set instead of updated
(++=) with additional flags.
The unreported bug was that `_` no longer set all settings.
The corrected behavior is that "contains" means "it was enabled, or
_ was set and it was not disabled explicitly."
That is the behavior of `-Xlint` but with a different mechanism,
since each lint option is a Setting.
A semantic difference is that -Xlint enables all the lint options,
but -language does not enable all the language features. `scalac -X` does
not explain this additional behavior of the `-Xlint` flag.
Also worth noting that `scalac -feature -language unused.scala` failed
in 2.11.1 but succeeds silently now.
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/t8736-b.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t8736-b.scala | 7 | ||||
-rw-r--r-- | test/files/pos/t8736.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t8736.scala | 7 |
4 files changed, 16 insertions, 0 deletions
diff --git a/test/files/pos/t8736-b.flags b/test/files/pos/t8736-b.flags new file mode 100644 index 0000000000..1ad4eabe0f --- /dev/null +++ b/test/files/pos/t8736-b.flags @@ -0,0 +1 @@ +-feature -language:_ -Xfatal-warnings diff --git a/test/files/pos/t8736-b.scala b/test/files/pos/t8736-b.scala new file mode 100644 index 0000000000..903292d232 --- /dev/null +++ b/test/files/pos/t8736-b.scala @@ -0,0 +1,7 @@ +// scalac: -feature -language:_ -Xfatal-warnings +// showing that all are set +class X { + def hk[M[_]] = ??? + + implicit def imp(x: X): Int = x.hashCode +} diff --git a/test/files/pos/t8736.flags b/test/files/pos/t8736.flags new file mode 100644 index 0000000000..7fe42f7340 --- /dev/null +++ b/test/files/pos/t8736.flags @@ -0,0 +1 @@ +-feature -language:implicitConversions -language:higherKinds -language:-implicitConversions -Xfatal-warnings diff --git a/test/files/pos/t8736.scala b/test/files/pos/t8736.scala new file mode 100644 index 0000000000..46c0cdfd00 --- /dev/null +++ b/test/files/pos/t8736.scala @@ -0,0 +1,7 @@ +// scalac: -feature -language:implicitConversions -language:higherKinds -language:-implicitConversions -Xfatal-warnings +// showing that multiple settings are respected, and explicit enablement has precedence +class X { + def hk[M[_]] = ??? + + implicit def imp(x: X): Int = x.hashCode +} |