Skip to content

Commit bf86fcb

Browse files
committed
Implement missing case native + native in StringBuiltins.AddNode
1 parent 113c4db commit bf86fcb

File tree

1 file changed

+11
-0
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/str

1 file changed

+11
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/str/StringBuiltins.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,17 @@ Object doSNative(VirtualFrame frame, Object self, PythonAbstractNativeObject oth
536536
}
537537
}
538538

539+
@Specialization(guards = "isString(other)")
540+
Object doNativeS(VirtualFrame frame, PythonAbstractNativeObject self, Object other,
541+
@Cached CastToJavaStringNode cast,
542+
@Cached AddNode recurse) {
543+
try {
544+
return recurse.execute(frame, cast.execute(self), other);
545+
} catch (CannotCastException e) {
546+
throw raise(TypeError, ErrorMessages.CAN_ONLY_CONCAT_S_NOT_P_TO_S, "str", other, "str");
547+
}
548+
}
549+
539550
@Specialization
540551
Object doNative(VirtualFrame frame, PythonAbstractNativeObject self, PythonAbstractNativeObject other,
541552
@Cached CastToJavaStringNode cast,

0 commit comments

Comments
 (0)