Skip to content

Commit a7103f1

Browse files
committed
move args definition to the top of the script
1 parent 14155cd commit a7103f1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

modules/build/src/main/scala/scala/build/internal/CustomCodeWrapper.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ $packageDirective
5252

5353

5454
object ${indexedWrapperName.backticked} {
55+
def args = $name.args$$
5556
""")
5657
val bottom = AmmUtil.normalizeNewlines(s"""
57-
def args = $name.args$$
58-
$extraCode
58+
$extraCode
5959
}
6060
$aliasObject
6161
$mainObjectCode

modules/integration/src/test/scala/scala/cli/integration/RunScriptTestDefinitions.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ trait RunScriptTestDefinitions { _: RunTestDefinitions =>
172172
val expectedLines =
173173
if (actualScalaVersion.startsWith("2.12."))
174174
s"""Exception in thread "main" java.lang.ExceptionInInitializerError
175-
|${tab}at throws_sc$$.main(throws.sc:24)
175+
|${tab}at throws_sc$$.main(throws.sc:23)
176176
|${tab}at throws_sc.main(throws.sc)
177177
|Caused by: java.lang.Exception: Caught exception during processing
178178
|${tab}at throws$$.<init>(throws.sc:6)
@@ -185,7 +185,7 @@ trait RunScriptTestDefinitions { _: RunTestDefinitions =>
185185
|$tab... 3 more""".stripMargin.linesIterator.toVector
186186
else
187187
s"""Exception in thread "main" java.lang.ExceptionInInitializerError
188-
|${tab}at throws_sc$$.main(throws.sc:24)
188+
|${tab}at throws_sc$$.main(throws.sc:23)
189189
|${tab}at throws_sc.main(throws.sc)
190190
|Caused by: java.lang.Exception: Caught exception during processing
191191
|${tab}at throws$$.<clinit>(throws.sc:6)
@@ -244,7 +244,7 @@ trait RunScriptTestDefinitions { _: RunTestDefinitions =>
244244
val tab = "\t"
245245
val expectedLines =
246246
s"""Exception in thread "main" java.lang.ExceptionInInitializerError
247-
|${tab}at throws_sc$$.main(throws.sc:26)
247+
|${tab}at throws_sc$$.main(throws.sc:25)
248248
|${tab}at throws_sc.main(throws.sc)
249249
|Caused by: java.lang.Exception: Caught exception during processing
250250
|${tab}at throws$$.<clinit>(throws.sc:8)

0 commit comments

Comments
 (0)