diff --git a/src/end-to-end.test.ts b/src/end-to-end.test.ts index 1cfc345..7152b31 100644 --- a/src/end-to-end.test.ts +++ b/src/end-to-end.test.ts @@ -62,7 +62,7 @@ testCases(endToEnd, code => code)('end-to-end tests', [ ['({ ((a): :(b)) ((b): B) })', either.makeRight({ a: 'B', b: 'B' })], ['{ (a: :(")")), (")": (B)) }', either.makeRight({ a: 'B', ')': 'B' })], [':match({ a: A })({ tag: a, value: {} })', either.makeRight('A')], - [':{string concatenate}(a)(b)', either.makeRight('ab')], + [':{string concatenate}(a)(b)', either.makeRight('ba')], [ `{ "static data":"blah blah blah" diff --git a/src/language/compiling/semantics/prelude.ts b/src/language/compiling/semantics/prelude.ts index 012df5f..cdf099e 100644 --- a/src/language/compiling/semantics/prelude.ts +++ b/src/language/compiling/semantics/prelude.ts @@ -509,7 +509,7 @@ export const prelude: ObjectNode = makeObjectNode({ return: types.string, }), }, - string1 => + string2 => either.makeRight( makeFunctionNode( { @@ -518,11 +518,11 @@ export const prelude: ObjectNode = makeObjectNode({ }, serializePartiallyAppliedFunction( ['string', 'concatenate'], - string1, + string2, ), option.none, - string2 => { - if (typeof string1 !== 'string' || typeof string2 !== 'string') { + string1 => { + if (typeof string1 !== 'string' || typeof string1 !== 'string') { return either.makeLeft({ kind: 'panic', message: 'concatenate received a non-string argument',