diff options
author | Simon Ochsenreither <simon@ochsenreither.de> | 2013-09-08 16:38:52 +0200 |
---|---|---|
committer | Simon Ochsenreither <simon@ochsenreither.de> | 2013-10-24 00:52:01 +0200 |
commit | bc475036c4cae5e9534ee3f9985e4e7a848e4b67 (patch) | |
tree | 8e8009cc5ead2bc6b320da8827753f30916b9cad /test/files | |
parent | 951422163ab8fc47caa60acb66b670a371b5489e (diff) | |
download | scala-bc475036c4cae5e9534ee3f9985e4e7a848e4b67.tar.gz scala-bc475036c4cae5e9534ee3f9985e4e7a848e4b67.tar.bz2 scala-bc475036c4cae5e9534ee3f9985e4e7a848e4b67.zip |
SI-7605 Deprecate procedure syntax
This commit covers three cases:
- constructor definitions (def this {...})
- concrete method definitions (def foo {...})
- abstract method declarations (def foo)
The deprecation is currently hidden behind -Xfuture pending IDE support
for migrating users from procedures to methods.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/t7605-deprecation.check | 12 | ||||
-rw-r--r-- | test/files/neg/t7605-deprecation.flags | 1 | ||||
-rw-r--r-- | test/files/neg/t7605-deprecation.scala | 5 |
3 files changed, 18 insertions, 0 deletions
diff --git a/test/files/neg/t7605-deprecation.check b/test/files/neg/t7605-deprecation.check new file mode 100644 index 0000000000..9c466c058c --- /dev/null +++ b/test/files/neg/t7605-deprecation.check @@ -0,0 +1,12 @@ +t7605-deprecation.scala:2: warning: Procedure syntax is deprecated. Convert procedure to method by adding `: Unit =`. + def this(i: Int) { this() } + ^ +t7605-deprecation.scala:3: warning: Procedure syntax is deprecated. Convert procedure to method by adding `: Unit =`. + def bar {} + ^ +t7605-deprecation.scala:4: warning: Procedure syntax is deprecated. Convert procedure to method by adding `: Unit`. + def baz + ^ +error: No warnings can be incurred under -Xfatal-warnings. +three warnings found +one error found diff --git a/test/files/neg/t7605-deprecation.flags b/test/files/neg/t7605-deprecation.flags new file mode 100644 index 0000000000..0a7cb7d202 --- /dev/null +++ b/test/files/neg/t7605-deprecation.flags @@ -0,0 +1 @@ +-deprecation -Xfuture -Xfatal-warnings diff --git a/test/files/neg/t7605-deprecation.scala b/test/files/neg/t7605-deprecation.scala new file mode 100644 index 0000000000..4a7dcd26d6 --- /dev/null +++ b/test/files/neg/t7605-deprecation.scala @@ -0,0 +1,5 @@ +abstract class Foo { + def this(i: Int) { this() } + def bar {} + def baz +}
\ No newline at end of file |