From 8cd33684c2453b55fc84321441675c798b29b5b1 Mon Sep 17 00:00:00 2001 From: Richard Gong Date: Thu, 16 Jan 2020 17:26:58 +0800 Subject: [PATCH] Updated TypeChecker.java, thanks to geektime user Geek_54edc1. --- playscript-java/src/main/play/TypeChecker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playscript-java/src/main/play/TypeChecker.java b/playscript-java/src/main/play/TypeChecker.java index 0807213..6e7518d 100644 --- a/playscript-java/src/main/play/TypeChecker.java +++ b/playscript-java/src/main/play/TypeChecker.java @@ -27,7 +27,7 @@ public void exitVariableDeclarator(VariableDeclaratorContext ctx) { if (ctx.variableInitializer() != null){ Variable variable = (Variable) at.symbolOfNode.get(ctx.variableDeclaratorId()); Type type1 = variable.type; - Type type2 = at.typeOfNode.get(ctx.variableDeclaratorId()); + Type type2 = at.typeOfNode.get(ctx.variableInitializer()); checkAssign(type1,type2,ctx,ctx.variableDeclaratorId(),ctx.variableInitializer()); } }