Skip to content

Commit 06fa88a

Browse files
committed
[truffle] Added a coercion from ints to str
1 parent 47b04cd commit 06fa88a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

nqp-truffle.nqp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,12 @@ class QAST::TruffleCompiler {
250250
}
251251
}
252252

253+
if $desired == $T_STR {
254+
if $got == $T_INT {
255+
return TAST.new($T_OBJ, ['coerce-int-to-num', $tast.tree]);
256+
}
257+
}
258+
253259
# TODO - Perl 6 proper does it differently than nqp
254260
if $got == $T_OBJ {
255261
if $desired == $T_STR {

src/vm/jvm/bin/write_a_node.nqp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,5 @@ sub add_simple_op($name, $return_type, $args) {
9191
}
9292

9393

94-
add_simple_op('concat', $T_STR, [$T_STR, $T_STR]);
94+
add_simple_op('CoerceIntToStr', $T_STR, [$T_INT]);
9595

0 commit comments

Comments
 (0)