File tree 1 file changed +8
-4
lines changed
src/compiler/scala/tools/nsc/backend/jvm
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ trait BCodeIdiomatic {
44
44
if (emitStackMapFrame) asm.ClassWriter .COMPUTE_FRAMES else 0
45
45
)
46
46
47
- val StringBuilderClassName = " scala/collection/mutable /StringBuilder"
47
+ val StringBuilderClassName = " java/lang /StringBuilder"
48
48
49
49
val CLASS_CONSTRUCTOR_NAME = " <clinit>"
50
50
val INSTANCE_CONSTRUCTOR_NAME = " <init>"
@@ -226,9 +226,13 @@ trait BCodeIdiomatic {
226
226
*/
227
227
final def genStringConcat (el : BType ) {
228
228
229
- val jtype =
230
- if (el.isArray || el.isClass) ObjectReference
231
- else el
229
+ val jtype = el match {
230
+ case ct : ClassBType if ct.isSubtypeOf(StringReference ).get => StringReference
231
+ case ct : ClassBType if ct.isSubtypeOf(JavaStringBufferReference ).get => JavaStringBufferReference
232
+ case ct : ClassBType if ct.isSubtypeOf(JavaCharSequenceReference ).get => JavaCharSequenceReference
233
+ case rt : RefBType => ObjectReference
234
+ case pt : PrimitiveBType => pt
235
+ }
232
236
233
237
val bt = MethodBType (List (jtype), StringBuilderReference )
234
238
You can’t perform that action at this time.
0 commit comments