From 135d6116fcd3020359da0b355459fa81fad8ab94 Mon Sep 17 00:00:00 2001 From: hkc <779543729@qq.com> Date: Tue, 8 Jun 2021 17:01:30 +0800 Subject: [PATCH] fix when literal is string --- check.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check.ts b/check.ts index f56819c..5b2d25f 100644 --- a/check.ts +++ b/check.ts @@ -35,7 +35,7 @@ export function check(module: Module) { error(expression.pos, "Could not resolve " + expression.text) return errorType case Node.Literal: - return numberType + return typeof expression.value === 'string' ? stringType : numberType case Node.Assignment: const v = checkExpression(expression.value) const t = checkExpression(expression.name)