Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/end-to-end.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ testCases(endToEnd, code => code)('end-to-end tests', [
assert.fail(result.value.message)
}
assert(typeof result.value === 'object')
assert.deepEqual(result.value.b, 'A')
assert.deepEqual(result.value['b'], 'A')
},
],
[
Expand Down Expand Up @@ -143,8 +143,8 @@ testCases(endToEnd, code => code)('end-to-end tests', [
assert.fail(output.value.message)
}
assert(typeof output.value === 'object')
assert.deepEqual(output.value.tag, 'some')
assert.deepEqual(typeof output.value.value, 'string')
assert.deepEqual(output.value['tag'], 'some')
assert.deepEqual(typeof output.value['value'], 'string')
},
],
[
Expand All @@ -166,8 +166,8 @@ testCases(endToEnd, code => code)('end-to-end tests', [
assert.fail(output.value.message)
}
assert(typeof output.value === 'object')
assert.deepEqual(output.value.tag, 'some')
assert.deepEqual(typeof output.value.value, 'string')
assert.deepEqual(output.value['tag'], 'some')
assert.deepEqual(typeof output.value['value'], 'string')
},
],
[
Expand All @@ -189,8 +189,8 @@ testCases(endToEnd, code => code)('end-to-end tests', [
assert.fail(output.value.message)
}
assert(typeof output.value === 'object')
assert.deepEqual(output.value.tag, 'some')
assert.deepEqual(typeof output.value.value, 'string')
assert.deepEqual(output.value['tag'], 'some')
assert.deepEqual(typeof output.value['value'], 'string')
},
],
[
Expand All @@ -202,8 +202,8 @@ testCases(endToEnd, code => code)('end-to-end tests', [
assert.fail(output.value.message)
}
assert(typeof output.value === 'object')
assert.deepEqual(output.value.tag, 'some')
assert.deepEqual(typeof output.value.value, 'string')
assert.deepEqual(output.value['tag'], 'some')
assert.deepEqual(typeof output.value['value'], 'string')
},
],
[`:natural_number.add(1)(1)`, either.makeRight('2')],
Expand Down
2 changes: 1 addition & 1 deletion src/language/compiling/semantics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ elaborationSuite('@runtime', [
{ 0: '@runtime', 1: { 0: '@lookup', query: { 0: 'identity' } } },
either.makeRight(
withPhantomData<never>()(
makeObjectNode({ 0: '@runtime', function: prelude.identity! }),
makeObjectNode({ 0: '@runtime', function: prelude['identity']! }),
),
),
],
Expand Down
4 changes: 2 additions & 2 deletions src/language/runtime/evaluator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ testCases(evaluate, input => `evaluating \`${JSON.stringify(input)}\``)(
output => {
assert(!either.isLeft(output))
assert(typeof output.value === 'object')
assert(output.value.tag === 'some')
assert(typeof output.value.value === 'string')
assert(output.value['tag'] === 'some')
assert(typeof output.value['value'] === 'string')
},
],
[
Expand Down
8 changes: 4 additions & 4 deletions src/language/semantics/prelude.ts
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ type TaggedNode = ObjectNode & {
}
const nodeIsTagged = (node: SemanticGraph): node is TaggedNode =>
isObjectNode(node) &&
node.tag !== undefined &&
(typeof node.tag === 'string' ||
(isSemanticGraph(node.tag) && typeof node.tag === 'string')) &&
node.value !== undefined
node['tag'] !== undefined &&
(typeof node['tag'] === 'string' ||
(isSemanticGraph(node['tag']) && typeof node['tag'] === 'string')) &&
node['value'] !== undefined
3 changes: 3 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
"composite": true,
"exactOptionalPropertyTypes": true,
"module": "node16",
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"noUncheckedSideEffectImports": true,
"rootDir": "./src",
"skipLibCheck": true,
"strict": true,
"target": "es2023",
"verbatimModuleSyntax": true
Expand Down