summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2012-07-19 16:34:57 +0200
committerGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2012-07-19 16:34:57 +0200
commitee0d01785ebc7b72164ad4e0d6a952d99a5f21f2 (patch)
tree6d0ca1334d4b4674b984b344fa80d4a39520d9a5
parent45232af4de715ec118f8b9ab9cce25c33540c0d6 (diff)
downloadscala-ee0d01785ebc7b72164ad4e0d6a952d99a5f21f2.tar.gz
scala-ee0d01785ebc7b72164ad4e0d6a952d99a5f21f2.tar.bz2
scala-ee0d01785ebc7b72164ad4e0d6a952d99a5f21f2.zip
Deprecate all JVM 1.5 targets and make 1.6 default.
Add a check if deprecated target is being used. I put that check into `checkDeprecatedSettings`. I tried to invent some general mechanism for deprecating choices in ChoiceSetting but I gave up eventually. It wasn't worth it the complexity. Also, with current approach I'm able to provide nice, customized deprecation warning. Make `jvm-1.6` a default backend. Altered test for SI-5957 because it crashes the backend. However, the problem is not with backend but with symbol creation. We get two different symbols with the same internal name and both are used in trees that reach GenASM. See SI-6109 for details. Review by @magarciaEPFL and @paulp.
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala2
-rw-r--r--src/compiler/scala/tools/nsc/settings/StandardScalaSettings.scala4
-rw-r--r--test/files/pos/t5957/T_1.scala6
3 files changed, 8 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala
index e378d71944..83335c4f62 100644
--- a/src/compiler/scala/tools/nsc/Global.scala
+++ b/src/compiler/scala/tools/nsc/Global.scala
@@ -1447,6 +1447,8 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
settings.userSetSettings filter (_.isDeprecated) foreach { s =>
unit.deprecationWarning(NoPosition, s.name + " is deprecated: " + s.deprecationMessage.get)
}
+ if (settings.target.value.contains("jvm-1.5"))
+ unit.deprecationWarning(NoPosition, settings.target.name + ":" + settings.target.value + " is deprecated: use target for Java 1.6 or above.")
}
/* An iterator returning all the units being compiled in this run */
diff --git a/src/compiler/scala/tools/nsc/settings/StandardScalaSettings.scala b/src/compiler/scala/tools/nsc/settings/StandardScalaSettings.scala
index f0ee8b11f3..0991577829 100644
--- a/src/compiler/scala/tools/nsc/settings/StandardScalaSettings.scala
+++ b/src/compiler/scala/tools/nsc/settings/StandardScalaSettings.scala
@@ -40,9 +40,9 @@ trait StandardScalaSettings {
val nowarn = BooleanSetting ("-nowarn", "Generate no warnings.")
val optimise: BooleanSetting // depends on post hook which mutates other settings
val print = BooleanSetting ("-print", "Print program with Scala-specific features removed.")
- val target = ChoiceSetting ("-target", "target", "Target platform for object files.",
+ val target = ChoiceSetting ("-target", "target", "Target platform for object files. All JVM 1.5 targets are deprecated.",
List("jvm-1.5", "jvm-1.5-fjbg", "jvm-1.5-asm", "jvm-1.6", "jvm-1.7", "msil"),
- "jvm-1.5-asm")
+ "jvm-1.6")
val unchecked = BooleanSetting ("-unchecked", "Enable detailed unchecked (erasure) warnings.")
val uniqid = BooleanSetting ("-uniqid", "Uniquely tag all identifiers in debugging output.")
val usejavacp = BooleanSetting ("-usejavacp", "Utilize the java.class.path in classpath resolution.")
diff --git a/test/files/pos/t5957/T_1.scala b/test/files/pos/t5957/T_1.scala
index 1db5a3891f..339dcbf0f0 100644
--- a/test/files/pos/t5957/T_1.scala
+++ b/test/files/pos/t5957/T_1.scala
@@ -1,6 +1,8 @@
abstract class T {
- def t1: Test$Bar
+ // see: SI-6109
+ // def t1: Test$Bar
def t2: Test#Bar
- def t3: Test$Baz
+ // see: SI-6109
+ // def t3: Test$Baz
def t4: Test.Baz
}