From 799f6819915f83ea09d264812bd9af058e667838 Mon Sep 17 00:00:00 2001 From: jespergravgaard <jesper@balmangravgaard.dk> Date: Sat, 8 May 2021 13:33:17 +0200 Subject: [PATCH] Fixed problem with constantifying struct initializers. Closes #653 --- .../dk/camelot64/kickc/model/types/SymbolTypeInference.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/dk/camelot64/kickc/model/types/SymbolTypeInference.java b/src/main/java/dk/camelot64/kickc/model/types/SymbolTypeInference.java index 87c2d3920..85a1d0fcf 100644 --- a/src/main/java/dk/camelot64/kickc/model/types/SymbolTypeInference.java +++ b/src/main/java/dk/camelot64/kickc/model/types/SymbolTypeInference.java @@ -110,6 +110,8 @@ public class SymbolTypeInference { if(structMember == null) throw new CompileError("Unknown struct member " + structMemberRef.getMemberName() + " in struct " + structType.getTypeName()); return structMember.getType(); + } else if(structType.equals(SymbolType.VAR)) { + return SymbolType.VAR; } else { throw new CompileError("Dot applied to non-struct "+ structMemberRef.getStruct().toString()); }