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 75ef3d7e5..4a244cbdb 100644 --- a/src/main/java/dk/camelot64/kickc/model/types/SymbolTypeInference.java +++ b/src/main/java/dk/camelot64/kickc/model/types/SymbolTypeInference.java @@ -118,7 +118,12 @@ public class SymbolTypeInference { } else if(rValue instanceof RangeComparison) { return ((RangeComparison) rValue).getType(); } else if(rValue instanceof RangeNext) { - return inferType(symbols, ((RangeNext) rValue).getRangeFirst()); + SymbolType rangedType = inferType(symbols, ((RangeNext) rValue).getRangeFirst()); + if(SymbolType.SBYTE.equals(rangedType) || SymbolType.SWORD.equals(rangedType) || SymbolType.SDWORD.equals(rangedType)) { + return SymbolType.SBYTE; + } else { + return SymbolType.BYTE; + } } else if(rValue instanceof ProcedureRef) { Procedure procedure = symbols.getProcedure((ProcedureRef) rValue); return procedure.getType();