Skip to content

Commit c3dbd5b

Browse files
committed
Fix argument order of string.concatenate
1 parent 4c31df6 commit c3dbd5b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/end-to-end.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ testCases(endToEnd, code => code)('end-to-end tests', [
6262
['({ ((a): :(b)) ((b): B) })', either.makeRight({ a: 'B', b: 'B' })],
6363
['{ (a: :(")")), (")": (B)) }', either.makeRight({ a: 'B', ')': 'B' })],
6464
[':match({ a: A })({ tag: a, value: {} })', either.makeRight('A')],
65-
[':{string concatenate}(a)(b)', either.makeRight('ab')],
65+
[':{string concatenate}(a)(b)', either.makeRight('ba')],
6666
[
6767
`{
6868
"static data":"blah blah blah"

src/language/compiling/semantics/prelude.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ export const prelude: ObjectNode = makeObjectNode({
509509
return: types.string,
510510
}),
511511
},
512-
string1 =>
512+
string2 =>
513513
either.makeRight(
514514
makeFunctionNode(
515515
{
@@ -518,11 +518,11 @@ export const prelude: ObjectNode = makeObjectNode({
518518
},
519519
serializePartiallyAppliedFunction(
520520
['string', 'concatenate'],
521-
string1,
521+
string2,
522522
),
523523
option.none,
524-
string2 => {
525-
if (typeof string1 !== 'string' || typeof string2 !== 'string') {
524+
string1 => {
525+
if (typeof string1 !== 'string' || typeof string1 !== 'string') {
526526
return either.makeLeft({
527527
kind: 'panic',
528528
message: 'concatenate received a non-string argument',

0 commit comments

Comments
 (0)