-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dotc -target option problem #8633
Labels
Comments
A quick fix about % git diff -U0
diff --git a/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala b/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala
index 81e3284e1f..8dcb18f76c 100644
--- a/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala
+++ b/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala
@@ -26,6 +26,2 @@ trait BCodeIdiomatic {
- lazy val classfileVersion: Int = targetPlatform match {
- case "jvm-1.5" => asm.Opcodes.V1_5
- case "jvm-1.6" => asm.Opcodes.V1_6
- case "jvm-1.7" => asm.Opcodes.V1_7
- case "jvm-1.8" => asm.Opcodes.V1_8
- }
+ /** return [[scala.tools.asm.Opcodes.V1_8]] == 52 for `targetPlatform` "jvm-1.8" | "8" and so on */
+ lazy val classfileVersion: Int = targetPlatform.stripPrefix("jvm-1.").toInt + 44
diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala
index e1ec597d75..b69b8b79e0 100644
--- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala
+++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala
@@ -38 +38 @@ class ScalaSettings extends Settings.SettingGroup {
- List("jvm-1.5", "jvm-1.5-fjbg", "jvm-1.5-asm", "jvm-1.6", "jvm-1.7", "jvm-1.8", "msil"), "jvm-1.8") withAbbreviation "--target"
+ (8 to 15).flatMap(v => Seq(s"$v", s"jvm-1.$v")).toList, "8") withAbbreviation "--target" At least I can compile & run the |
ohze
changed the title
dotc -target, -release options problem
dotc -target option problem
Mar 30, 2020
We can't properly support |
This was fixed in #9181 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Some problems related to dotc target option:
msil
,jvm-1.5-fjbg
,jvm-1.5-asm
:The error is caused by this: BCodeIdiomatic.scala
(maybe?) runtime error targets:
jvm-1.5
,jvm-1.6
,jvm-1.7
dotc -target:jvm-1.5-asm hi.scala
success but I think we cannot run the output classes with jvm 1.5?don't have targets 9 to 15 which scala 2.13 has.
similar, scalac has option
-release 9
. IDK supporting this option in dotc is hard or not?EDIT: I have created a separated issue support
-release
option #8634 for-release
optionThe text was updated successfully, but these errors were encountered: