Explorar o código

patched forbidden new on value type

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@6844 8c9fc860-2736-0410-a75d-ab315db34111
felixf %!s(int64=9) %!d(string=hai) anos
pai
achega
f04bd3f6fa
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      source/FoxSemanticChecker.Mod

+ 3 - 0
source/FoxSemanticChecker.Mod

@@ -5187,6 +5187,9 @@ TYPE
 					IF (first =0) OR CheckVariable(parameter0) THEN
 						IF type0 IS SyntaxTree.PointerType THEN
 							type0 := type0(SyntaxTree.PointerType).pointerBase.resolved;
+						ELSIF type0 IS SyntaxTree.CellType THEN
+						ELSE
+							Error(position, Diagnostics.Invalid, "forbidden new on value type");
 						END;
 						IF type0 IS SyntaxTree.ArrayType THEN
 							arrayType := type0(SyntaxTree.ArrayType);