Skip to content

Commit 632f86b

Browse files
authored
refactor(tolk): small fixes (#144)
1 parent 6b04c57 commit 632f86b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@
278278
},
279279
{
280280
"command": "tolk.getUnresolvedIdentifiers",
281-
"title": "Tolk: Get Unresolved Identifiers"
281+
"title": "Tolk: Get Unresolved Identifiers",
282+
"category": "Tolk"
282283
},
283284
{
284285
"command": "ton.debug",

server/src/e2e/tolk/compiler-tests.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ suite("Compiler Tests Suite", () => {
4343
)
4444
const tolkFiles = glob.sync(testCasesPath, {windowsPathsNoEscape: true})
4545

46-
console.log("tolkFiles", tolkFiles.length)
47-
4846
for (const tolkFile of tolkFiles) {
4947
const testName = path.basename(tolkFile, ".tolk")
5048

server/src/languages/tolk/type-inference.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,7 @@ class InferenceWalker {
519519
public inferReturnType(): Ty {
520520
const returnTypes = this.ctx.returnTypes
521521
if (returnTypes.length === 0) return VoidTy.VOID
522+
if (returnTypes.length === 1) return returnTypes[0]
522523

523524
let joined: Ty | null = null
524525

@@ -697,7 +698,7 @@ class InferenceWalker {
697698
}
698699

699700
private processReturnStatement(node: SyntaxNode, flow: FlowContext): FlowContext {
700-
const expression = node.child(1)
701+
const expression = node.childForFieldName("body")
701702
if (expression) {
702703
flow = this.inferExpression(
703704
expression,

0 commit comments

Comments
 (0)