File tree 2 files changed +18
-2
lines changed
src/dotty/tools/backend/jvm
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ trait BCodeSkelBuilder extends BCodeHelpers {
129
129
// reverse all the effects of this transformation, which would be counter-productive.
130
130
131
131
132
- // TODO: enable once we change lazy val encoding
132
+ // TODO: enable once we change lazy val encoding (https://github.com/lampepfl/dotty/issues/7140)
133
133
//
134
134
// Lazy val encoding assumes bitmap fields are non-static
135
135
//
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ object TestConfiguration {
8
8
9
9
val noCheckOptions = Array (
10
10
" -pagewidth" , " 120" ,
11
- " -color:never"
11
+ " -color:never" ,
12
+ " -target" , defaultTarget
12
13
)
13
14
14
15
val checkOptions = Array (
@@ -76,4 +77,19 @@ object TestConfiguration {
76
77
77
78
/** Enables explicit nulls */
78
79
val explicitNullsOptions = defaultOptions and " -Yexplicit-nulls"
80
+
81
+ /** Default target of the generated class files */
82
+ private def defaultTarget : String = {
83
+ import dotty .tools .dotc .config .Properties .javaVersion
84
+ val version : Int =
85
+ if (javaVersion.startsWith(" 1." )) javaVersion.substring(2 , 3 ).toInt
86
+ else {
87
+ val dot = javaVersion.indexOf(" ." )
88
+ assert(dot != - 1 , " unknown java version: " + javaVersion)
89
+ javaVersion.substring(0 , dot).toInt
90
+ }
91
+
92
+ if (version < 9 ) " jvm-1.8"
93
+ else " jvm-9"
94
+ }
79
95
}
You can’t perform that action at this time.
0 commit comments