Skip to content

Commit fdcda33

Browse files
committed
Fixes SI-6268. Review by @paulp and @lrytz.
This reverts a refactoring from scala@963aabbeb4 MultiString settings would not properly write an unparse string that could be reparsed, leading to failures when forking scalac in ant. Specifically, if a setting was empty, it was getting added to the unparse string and causing scalac to fail. This at least reverts to previous behavior (also more correct for multiple values). Whatever we do here has to work with the @file style argument reading and can't place empty options on the command line. Also, This assumes there are tests around the behvior the REPL needs. Note: The test is not automated yet, so unfortunately, we need to improve ANT testing capabilities to prevent regressons
1 parent 13002fe commit fdcda33

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

src/compiler/scala/tools/nsc/settings/MutableSettings.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ class MutableSettings(val errorFn: String => Unit)
536536
}
537537
override def tryToSetColon(args: List[String]) = tryToSet(args)
538538
override def tryToSetFromPropertyValue(s: String) = tryToSet(s.trim.split(',').toList)
539-
def unparse: List[String] = name :: value
539+
def unparse: List[String] = value map (name + ":" + _)
540540

541541
withHelpSyntax(name + ":<" + arg + ">")
542542
}

test/ant/test-basic/build.xml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<project name="test-simple" default="compile">
4+
<description>Super simple test for Scala</description>
5+
6+
<target name="init">
7+
<!-- Define project CLASSPATH. -->
8+
<property name="base.dir" value="../../.."/>
9+
<property name="pack.dir" value="${base.dir}/build/pack/"/>
10+
<property name="build.dir" value="classes"/>
11+
<property name="src.dir" value="src"/>
12+
<property name="jvmargs" value=""/>
13+
<path id="scala.classpath">
14+
<fileset dir="${pack.dir}/lib/"> <include name="*.jar" /> </fileset>
15+
</path>
16+
17+
<!-- Define scala compiler, scaladoc, etc command -->
18+
<taskdef resource="scala/tools/ant/antlib.xml">
19+
<classpath refid="scala.classpath" />
20+
</taskdef>
21+
</target>
22+
23+
<target name="compile" depends="init">
24+
<mkdir dir="${build.dir}"/>
25+
26+
<scalac srcdir="${src.dir}" destdir="${build.dir}"
27+
classpathref="scala.classpath" fork="true" target="jvm-1.5"
28+
deprecation="no" addparams="-no-specialization"
29+
jvmargs="${jvmargs} -XX:+UseConcMarkSweepGC">
30+
<include name="**/*.scala"/>
31+
</scalac>
32+
</target>
33+
</project>

test/ant/test-basic/src/test-1.scala

Whitespace-only changes.

0 commit comments

Comments
 (0)