Browse Source

Merge branch 'feature/remove-stored-types' into feature/remove-storedtypes

Stan Hebben 4 years ago
parent
commit
7c0db135d6
100 changed files with 309 additions and 522 deletions
  1. 0
    1
      CodeFormatter/src/main/java/org/openzen/zenscript/formatter/ExpressionFormatter.java
  2. 4
    4
      CodeFormatter/src/main/java/org/openzen/zenscript/formatter/FormattingUtils.java
  3. 1
    12
      CodeFormatter/src/main/java/org/openzen/zenscript/formatter/TypeFormatter.java
  4. 44
    72
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/FunctionHeader.java
  5. 6
    11
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/FunctionParameter.java
  6. 14
    14
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/GenericMapper.java
  7. 3
    4
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/GenericName.java
  8. 1
    42
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/HighLevelDefinition.java
  9. 1
    8
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/ModuleSpace.java
  10. 1
    6
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/SemanticModule.java
  11. 1
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/annotations/NativeAnnotationDefinition.java
  12. 4
    6
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/annotations/PreconditionAnnotationDefinition.java
  13. 1
    1
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/annotations/PreconditionForMethod.java
  14. 1
    8
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/context/FileResolutionContext.java
  15. 2
    11
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/context/LocalTypeResolutionContext.java
  16. 1
    18
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/context/ModuleTypeResolutionContext.java
  17. 3
    3
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/context/StatementContext.java
  18. 8
    8
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/context/TypeContext.java
  19. 2
    6
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/context/TypeResolutionContext.java
  20. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/definition/ExpansionDefinition.java
  21. 1
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/definition/FunctionDefinition.java
  22. 0
    9
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/definition/InterfaceDefinition.java
  23. 4
    4
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/definition/VariantDefinition.java
  24. 1
    1
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/AndAndExpression.java
  25. 3
    3
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ArrayExpression.java
  26. 8
    8
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/CallArguments.java
  27. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/CapturedExpression.java
  28. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/CapturedThisExpression.java
  29. 1
    1
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/CompareExpression.java
  30. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConditionalExpression.java
  31. 1
    1
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantBoolExpression.java
  32. 1
    1
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantByteExpression.java
  33. 1
    1
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantCharExpression.java
  34. 1
    1
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantDoubleExpression.java
  35. 1
    1
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantFloatExpression.java
  36. 1
    1
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantIntExpression.java
  37. 1
    1
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantLongExpression.java
  38. 1
    1
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantSByteExpression.java
  39. 1
    1
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantShortExpression.java
  40. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantStringExpression.java
  41. 1
    1
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantUIntExpression.java
  42. 1
    1
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantULongExpression.java
  43. 1
    1
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantUShortExpression.java
  44. 1
    1
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantUSizeExpression.java
  45. 4
    4
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstructorSuperCallExpression.java
  46. 5
    5
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstructorThisCallExpression.java
  47. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/DummyExpression.java
  48. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/EnumConstantExpression.java
  49. 17
    19
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/Expression.java
  50. 2
    3
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ExpressionSymbol.java
  51. 4
    4
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ExpressionVisitor.java
  52. 4
    4
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ExpressionVisitorWithContext.java
  53. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/FunctionExpression.java
  54. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/GetFieldExpression.java
  55. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/GetStaticFieldExpression.java
  56. 3
    4
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/InvalidExpression.java
  57. 1
    1
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/IsExpression.java
  58. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/MakeConstExpression.java
  59. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/MapExpression.java
  60. 6
    6
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/MatchExpression.java
  61. 3
    3
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/NewExpression.java
  62. 3
    3
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/NullExpression.java
  63. 1
    1
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/OrOrExpression.java
  64. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/PanicExpression.java
  65. 4
    4
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/RangeExpression.java
  66. 1
    1
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/SameObjectExpression.java
  67. 0
    46
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/StorageCastExpression.java
  68. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/SupertypeCastExpression.java
  69. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ThisExpression.java
  70. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ThrowExpression.java
  71. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/TryConvertExpression.java
  72. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/TryRethrowAsExceptionExpression.java
  73. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/TryRethrowAsResultExpression.java
  74. 4
    4
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/VariantValueExpression.java
  75. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/WrapOptionalExpression.java
  76. 2
    3
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/generic/ParameterSuperBound.java
  77. 3
    6
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/generic/ParameterTypeBound.java
  78. 0
    5
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/generic/TypeParameter.java
  79. 4
    4
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/CasterMember.java
  80. 3
    3
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/ConstMember.java
  81. 1
    1
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/ConstructorMember.java
  82. 4
    5
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/FieldMember.java
  83. 3
    3
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/FunctionalMember.java
  84. 6
    6
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/GetterMember.java
  85. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/IDefinitionMember.java
  86. 6
    7
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/ImplementationMember.java
  87. 4
    4
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/InnerDefinition.java
  88. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/InnerDefinitionMember.java
  89. 6
    7
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/IteratorMember.java
  90. 5
    5
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/PropertyMember.java
  91. 4
    4
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/SetterMember.java
  92. 2
    3
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/StaticInitializerMember.java
  93. 5
    5
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/ref/CasterMemberRef.java
  94. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/ref/ConstMemberRef.java
  95. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/ref/DefinitionMemberRef.java
  96. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/ref/FieldMemberRef.java
  97. 3
    4
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/ref/FunctionalMemberRef.java
  98. 2
    2
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/ref/GetterMemberRef.java
  99. 5
    5
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/ref/ImplementationMemberRef.java
  100. 0
    0
      CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/ref/IteratorMemberRef.java

+ 0
- 1
CodeFormatter/src/main/java/org/openzen/zenscript/formatter/ExpressionFormatter.java View File

@@ -70,7 +70,6 @@ import org.openzen.zenscript.codemodel.expression.SetStaticFieldExpression;
70 70
 import org.openzen.zenscript.codemodel.expression.SetterExpression;
71 71
 import org.openzen.zenscript.codemodel.expression.StaticGetterExpression;
72 72
 import org.openzen.zenscript.codemodel.expression.StaticSetterExpression;
73
-import org.openzen.zenscript.codemodel.expression.StorageCastExpression;
74 73
 import org.openzen.zenscript.codemodel.expression.SupertypeCastExpression;
75 74
 import org.openzen.zenscript.codemodel.expression.ThisExpression;
76 75
 import org.openzen.zenscript.codemodel.expression.ThrowExpression;

+ 4
- 4
CodeFormatter/src/main/java/org/openzen/zenscript/formatter/FormattingUtils.java View File

@@ -30,7 +30,7 @@ import org.openzen.zenscript.codemodel.statement.TryCatchStatement;
30 30
 import org.openzen.zenscript.codemodel.statement.VarStatement;
31 31
 import org.openzen.zenscript.codemodel.statement.WhileStatement;
32 32
 import org.openzen.zenscript.codemodel.type.BasicTypeID;
33
-import org.openzen.zenscript.codemodel.type.StoredType;
33
+import org.openzen.zenscript.codemodel.type.TypeID;
34 34
 
35 35
 /**
36 36
  *
@@ -78,7 +78,7 @@ public class FormattingUtils {
78 78
 			if (parameter.variadic)
79 79
 				result.append("...");
80 80
 			
81
-			if (!settings.showAnyInFunctionHeaders || !parameter.type.isBasic(BasicTypeID.UNDETERMINED)) {
81
+			if (!settings.showAnyInFunctionHeaders || parameter.type != BasicTypeID.UNDETERMINED) {
82 82
 				result.append(" as ");
83 83
 				result.append(typeFormatter.format(header.getReturnType()));
84 84
 			}
@@ -86,7 +86,7 @@ public class FormattingUtils {
86 86
 			parameterIndex++;
87 87
 		}
88 88
 		result.append(")");
89
-		if (!settings.showAnyInFunctionHeaders || !header.getReturnType().isBasic(BasicTypeID.UNDETERMINED)) {
89
+		if (!settings.showAnyInFunctionHeaders || header.getReturnType() != BasicTypeID.UNDETERMINED) {
90 90
 			result.append(" as ");
91 91
 			result.append(typeFormatter.format(header.getReturnType()));
92 92
 		}
@@ -128,7 +128,7 @@ public class FormattingUtils {
128 128
 			result.append("<");
129 129
 			
130 130
 			int index = 0;
131
-			for (StoredType typeArgument : arguments.typeArguments) {
131
+			for (TypeID typeArgument : arguments.typeArguments) {
132 132
 				if (index > 0)
133 133
 					result.append(", ");
134 134
 				result.append(typeFormatter.format(typeArgument));

+ 1
- 12
CodeFormatter/src/main/java/org/openzen/zenscript/formatter/TypeFormatter.java View File

@@ -20,8 +20,6 @@ import org.openzen.zenscript.codemodel.type.GenericMapTypeID;
20 20
 import org.openzen.zenscript.codemodel.type.GenericTypeID;
21 21
 import org.openzen.zenscript.codemodel.type.IteratorTypeID;
22 22
 import org.openzen.zenscript.codemodel.type.RangeTypeID;
23
-import org.openzen.zenscript.codemodel.type.StoredType;
24
-import org.openzen.zenscript.codemodel.type.StringTypeID;
25 23
 import org.openzen.zenscript.codemodel.type.TypeID;
26 24
 import stdlib.Chars;
27 25
 import org.openzen.zenscript.codemodel.type.TypeVisitor;
@@ -42,20 +40,11 @@ public class TypeFormatter implements TypeVisitor<String>, GenericParameterBound
42 40
 	public String format(TypeID type) {
43 41
 		return type.accept(this);
44 42
 	}
45
-	
46
-	public String format(StoredType type) {
47
-		return type.type.accept(this) + (type.getSpecifiedStorage() == null ? "" : "`" + type.getSpecifiedStorage().toString());
48
-	}
49 43
 
50 44
 	@Override
51 45
 	public String visitBasic(BasicTypeID basic) {
52 46
 		return basic.name;
53 47
 	}
54
-	
55
-	@Override
56
-	public String visitString(StringTypeID string) {
57
-		return "string";
58
-	}
59 48
 
60 49
 	@Override
61 50
 	public String visitArray(ArrayTypeID array) {
@@ -97,7 +86,7 @@ public class TypeFormatter implements TypeVisitor<String>, GenericParameterBound
97 86
 		result.append(importedName);
98 87
 		result.append("<");
99 88
 		int index = 0;
100
-		for (StoredType typeParameter : definition.typeArguments) {
89
+		for (TypeID typeParameter : definition.typeArguments) {
101 90
 			if (index > 0)
102 91
 				result.append(", ");
103 92
 			

+ 44
- 72
CodeModel/src/main/java/org/openzen/zenscript/codemodel/FunctionHeader.java View File

@@ -15,9 +15,7 @@ import org.openzen.zenscript.codemodel.type.ArrayTypeID;
15 15
 import org.openzen.zenscript.codemodel.type.BasicTypeID;
16 16
 import org.openzen.zenscript.codemodel.type.GlobalTypeRegistry;
17 17
 import org.openzen.zenscript.codemodel.scope.TypeScope;
18
-import org.openzen.zenscript.codemodel.type.StoredType;
19
-import org.openzen.zenscript.codemodel.type.storage.AutoStorageTag;
20
-import org.openzen.zenscript.codemodel.type.storage.StorageTag;
18
+import org.openzen.zenscript.codemodel.type.TypeID;
21 19
 
22 20
 /**
23 21
  *
@@ -25,16 +23,15 @@ import org.openzen.zenscript.codemodel.type.storage.StorageTag;
25 23
  */
26 24
 public class FunctionHeader {
27 25
 	public final TypeParameter[] typeParameters;
28
-	private StoredType returnType;
26
+	private TypeID returnType;
29 27
 	public final FunctionParameter[] parameters;
30
-	public final StoredType thrownType;
31
-	public final StorageTag storage;
32
-	
28
+	public final TypeID thrownType;
29
+
33 30
 	public final int minParameters;
34 31
 	public final int maxParameters;
35 32
 	public final boolean hasUnknowns;
36 33
 	
37
-	public FunctionHeader(StoredType returnType) {
34
+	public FunctionHeader(TypeID returnType) {
38 35
 		if (returnType == null)
39 36
 			throw new NullPointerException();
40 37
 		
@@ -42,18 +39,13 @@ public class FunctionHeader {
42 39
 		this.returnType = returnType;
43 40
 		this.parameters = FunctionParameter.NONE;
44 41
 		this.thrownType = null;
45
-		this.storage = null;
46 42
 		
47 43
 		minParameters = 0;
48 44
 		maxParameters = 0;
49
-		hasUnknowns = returnType.type == BasicTypeID.UNDETERMINED;
50
-	}
51
-	
52
-	public FunctionHeader(BasicTypeID returnType) {
53
-		this(returnType.stored);
45
+		hasUnknowns = returnType == BasicTypeID.UNDETERMINED;
54 46
 	}
55 47
 	
56
-	public FunctionHeader(StoredType returnType, StoredType... parameterTypes) {
48
+	public FunctionHeader(TypeID returnType, TypeID... parameterTypes) {
57 49
 		if (returnType == null)
58 50
 			throw new NullPointerException();
59 51
 		
@@ -61,7 +53,6 @@ public class FunctionHeader {
61 53
 		this.returnType = returnType;
62 54
 		this.parameters = new FunctionParameter[parameterTypes.length];
63 55
 		this.thrownType = null;
64
-		this.storage = null;
65 56
 		
66 57
 		for (int i = 0; i < parameterTypes.length; i++)
67 58
 			parameters[i] = new FunctionParameter(parameterTypes[i], null);
@@ -71,11 +62,7 @@ public class FunctionHeader {
71 62
 		hasUnknowns = hasUnknowns(parameterTypes, returnType);
72 63
 	}
73 64
 	
74
-	public FunctionHeader(BasicTypeID returnType, StoredType... parameterTypes) {
75
-		this(returnType.stored, parameterTypes);
76
-	}
77
-	
78
-	public FunctionHeader(StoredType returnType, FunctionParameter... parameters) {
65
+	public FunctionHeader(TypeID returnType, FunctionParameter... parameters) {
79 66
 		if (returnType == null)
80 67
 			throw new NullPointerException();
81 68
 		
@@ -83,18 +70,13 @@ public class FunctionHeader {
83 70
 		this.returnType = returnType;
84 71
 		this.parameters = parameters;
85 72
 		this.thrownType = null;
86
-		this.storage = null;
87 73
 		
88 74
 		minParameters = getMinParameters(parameters);
89 75
 		maxParameters = getMaxParameters(parameters);
90 76
 		hasUnknowns = hasUnknowns(parameters, returnType);
91 77
 	}
92 78
 	
93
-	public FunctionHeader(BasicTypeID returnType, FunctionParameter... parameters) {
94
-		this(returnType.stored, parameters);
95
-	}
96
-	
97
-	public FunctionHeader(TypeParameter[] typeParameters, StoredType returnType, StoredType thrownType, StorageTag storage, FunctionParameter... parameters) {
79
+	public FunctionHeader(TypeParameter[] typeParameters, TypeID returnType, TypeID thrownType, FunctionParameter... parameters) {
98 80
 		if (returnType == null)
99 81
 			throw new NullPointerException();
100 82
 		if (typeParameters == null)
@@ -104,7 +86,6 @@ public class FunctionHeader {
104 86
 		this.returnType = returnType;
105 87
 		this.parameters = parameters;
106 88
 		this.thrownType = thrownType;
107
-		this.storage = storage;
108 89
 		
109 90
 		minParameters = getMinParameters(parameters);
110 91
 		maxParameters = getMaxParameters(parameters);
@@ -149,26 +130,26 @@ public class FunctionHeader {
149 130
 		return useTypeParameters;
150 131
 	}
151 132
 	
152
-	public StoredType getReturnType() {
133
+	public TypeID getReturnType() {
153 134
 		return returnType;
154 135
 	}
155 136
 	
156
-	public void setReturnType(StoredType returnType) {
137
+	public void setReturnType(TypeID returnType) {
157 138
 		if (returnType == null)
158 139
 			throw new NullPointerException();
159 140
 		
160 141
 		this.returnType = returnType;
161 142
 	}
162 143
 	
163
-	public StoredType getParameterType(boolean isVariadic, int index) {
144
+	public TypeID getParameterType(boolean isVariadic, int index) {
164 145
 		return getParameter(isVariadic, index).type;
165 146
 	}
166 147
 	
167 148
 	public FunctionParameter getParameter(boolean isVariadic, int index) {
168 149
 		if (isVariadic && index >= parameters.length - 1) {
169 150
 			final FunctionParameter parameter = parameters[parameters.length - 1];
170
-			if(parameter.type.type instanceof ArrayTypeID) {
171
-				return new FunctionParameter(((ArrayTypeID) parameter.type.type).elementType, parameter.name);
151
+			if(parameter.type instanceof ArrayTypeID) {
152
+				return new FunctionParameter(((ArrayTypeID) parameter.type).elementType, parameter.name);
172 153
 			}
173 154
 			return parameter;
174 155
 		} else {
@@ -193,7 +174,7 @@ public class FunctionHeader {
193 174
 		FunctionParameter[] normalizedParameters = new FunctionParameter[parameters.length];
194 175
 		for (int i = 0; i < normalizedParameters.length; i++)
195 176
 			normalizedParameters[i] = parameters[i].normalize(registry);
196
-		return new FunctionHeader(typeParameters, returnType.getNormalized(), thrownType == null ? null : thrownType.getNormalized(), storage, normalizedParameters);
177
+		return new FunctionHeader(typeParameters, returnType.getNormalized(), thrownType == null ? null : thrownType.getNormalized(), normalizedParameters);
197 178
 	}
198 179
 	
199 180
 	public int getNumberOfTypeParameters() {
@@ -210,28 +191,24 @@ public class FunctionHeader {
210 191
 	
211 192
 	public FunctionHeader inferFromOverride(GlobalTypeRegistry registry, FunctionHeader overridden) {
212 193
 		TypeParameter[] resultTypeParameters = typeParameters;
213
-		StoredType resultReturnType = this.returnType;
214
-		if (resultReturnType.type == BasicTypeID.UNDETERMINED)
194
+		TypeID resultReturnType = this.returnType;
195
+		if (resultReturnType == BasicTypeID.UNDETERMINED)
215 196
 			resultReturnType = overridden.returnType;
216
-		
217
-		StoredType resultThrownType = this.thrownType;
197
+
198
+		TypeID resultThrownType = this.thrownType;
218 199
 		if (resultThrownType == null && overridden.thrownType != null)
219 200
 			resultThrownType = overridden.thrownType;
220 201
 		
221 202
 		FunctionParameter[] resultParameters = Arrays.copyOf(parameters, parameters.length);
222 203
 		for (int i = 0; i < resultParameters.length; i++) {
223
-			if (resultParameters[i].type.type == BasicTypeID.UNDETERMINED) {
204
+			if (resultParameters[i].type == BasicTypeID.UNDETERMINED) {
224 205
 				FunctionParameter parameter = resultParameters[i];
225 206
 				FunctionParameter original = overridden.parameters[i];
226 207
 				resultParameters[i] = new FunctionParameter(original.type, parameter.name, parameter.defaultValue, original.variadic);
227 208
 			}
228 209
 		}
229 210
 		
230
-		StorageTag resultStorage = this.storage;
231
-		if (resultStorage == null)
232
-			resultStorage = overridden.storage;
233
-		
234
-		return new FunctionHeader(resultTypeParameters, resultReturnType, resultThrownType, resultStorage, resultParameters);
211
+		return new FunctionHeader(resultTypeParameters, resultReturnType, resultThrownType, resultParameters);
235 212
 	}
236 213
 	
237 214
 	public boolean matchesExactly(CodePosition position, CallArguments arguments, TypeScope scope) {
@@ -285,8 +262,6 @@ public class FunctionHeader {
285 262
 			}
286 263
 			result.append('>');
287 264
 		}
288
-		if (storage != null && storage != AutoStorageTag.INSTANCE)
289
-			result.append('`').append(storage);
290 265
 		result.append('(');
291 266
 		for (int i = 0; i < parameters.length; i++) {
292 267
 			if (i > 0)
@@ -298,7 +273,7 @@ public class FunctionHeader {
298 273
 	}
299 274
 	
300 275
 	public String getCanonical() {
301
-		return getCanonicalWithoutReturnType() + returnType.type.toString();
276
+		return getCanonicalWithoutReturnType() + returnType.toString();
302 277
 	}
303 278
 	
304 279
 	public boolean hasInferenceBlockingTypeParameters(TypeParameter[] parameters) {
@@ -326,11 +301,11 @@ public class FunctionHeader {
326 301
 			throw new NullPointerException();
327 302
 		if (parameters.length != other.parameters.length)
328 303
 			return false;
329
-		if (returnType.type != BasicTypeID.UNDETERMINED && !scope.getTypeMembers(returnType).canCastImplicit(other.returnType))
304
+		if (returnType != BasicTypeID.UNDETERMINED && !scope.getTypeMembers(returnType).canCastImplicit(other.returnType))
330 305
 			return false;
331 306
 		
332 307
 		for (int i = 0; i < parameters.length; i++) {
333
-			if (parameters[i].type.type == BasicTypeID.UNDETERMINED)
308
+			if (parameters[i].type == BasicTypeID.UNDETERMINED)
334 309
 				continue;
335 310
 			
336 311
 			if (parameters[i].variadic != other.parameters[i].variadic)
@@ -395,7 +370,7 @@ public class FunctionHeader {
395 370
 	
396 371
 	public FunctionHeader instanceForCall(CodePosition position, GlobalTypeRegistry registry, CallArguments arguments) {
397 372
 		if (arguments.getNumberOfTypeArguments() > 0) {
398
-			Map<TypeParameter, StoredType> typeParameters = StoredType.getMapping(this.typeParameters, arguments.typeArguments);
373
+			Map<TypeParameter, TypeID> typeParameters = TypeID.getMapping(this.typeParameters, arguments.typeArguments);
399 374
 			return instance(new GenericMapper(position, registry, typeParameters));
400 375
 		} else {
401 376
 			return this;
@@ -404,37 +379,37 @@ public class FunctionHeader {
404 379
 	
405 380
 	public FunctionHeader withGenericArguments(GenericMapper mapper) {
406 381
 		if (typeParameters.length > 0)
407
-			mapper = mapper.getInner(mapper.position, mapper.registry, StoredType.getSelfMapping(mapper.registry, typeParameters));
382
+			mapper = mapper.getInner(mapper.position, mapper.registry, TypeID.getSelfMapping(mapper.registry, typeParameters));
408 383
 		
409 384
 		return instance(mapper);
410 385
 	}
411 386
 	
412 387
 	private FunctionHeader instance(GenericMapper mapper) {
413
-		StoredType returnType = this.returnType.instance(mapper);
388
+		TypeID returnType = this.returnType.instance(mapper);
414 389
 		FunctionParameter[] parameters = new FunctionParameter[this.parameters.length];
415 390
 		for (int i = 0; i < parameters.length; i++) {
416 391
 			parameters[i] = this.parameters[i].withGenericArguments(mapper);
417 392
 		}
418
-		return new FunctionHeader(typeParameters, returnType, thrownType == null ? null : thrownType.instance(mapper), storage, parameters);
393
+		return new FunctionHeader(typeParameters, returnType, thrownType == null ? null : thrownType.instance(mapper), parameters);
419 394
 	}
420 395
 	
421
-	public FunctionHeader fillGenericArguments(CodePosition position, TypeScope scope, StoredType[] arguments) {
396
+	public FunctionHeader fillGenericArguments(CodePosition position, TypeScope scope, TypeID[] arguments) {
422 397
 		if (arguments == null || arguments.length == 0)
423 398
 			return this;
424 399
 		
425
-		Map<TypeParameter, StoredType> typeArguments = StoredType.getMapping(typeParameters, arguments);
400
+		Map<TypeParameter, TypeID> typeArguments = TypeID.getMapping(typeParameters, arguments);
426 401
 		GenericMapper mapper = scope.getLocalTypeParameters().getInner(position, scope.getTypeRegistry(), typeArguments);
427
-		
428
-		StoredType returnType = this.returnType.instance(mapper);
402
+
403
+		TypeID returnType = this.returnType.instance(mapper);
429 404
 		FunctionParameter[] parameters = new FunctionParameter[this.parameters.length];
430 405
 		for (int i = 0; i < parameters.length; i++) {
431 406
 			parameters[i] = this.parameters[i].withGenericArguments(mapper);
432 407
 		}
433
-		return new FunctionHeader(TypeParameter.NONE, returnType, thrownType == null ? null : thrownType.instance(mapper), storage, parameters);
408
+		return new FunctionHeader(TypeParameter.NONE, returnType, thrownType == null ? null : thrownType.instance(mapper), parameters);
434 409
 	}
435 410
 	
436 411
 	public FunctionHeader forTypeParameterInference() {
437
-		return new FunctionHeader(BasicTypeID.UNDETERMINED.stored, parameters);
412
+		return new FunctionHeader(BasicTypeID.UNDETERMINED, parameters);
438 413
 	}
439 414
 	
440 415
 	public FunctionHeader forLambda(FunctionHeader lambdaHeader) {
@@ -442,7 +417,7 @@ public class FunctionHeader {
442 417
 		for (int i = 0; i < lambdaHeader.parameters.length; i++)
443 418
 			parameters[i] = new FunctionParameter(this.parameters[i].type, lambdaHeader.parameters[i].name);
444 419
 		
445
-		return new FunctionHeader(typeParameters, returnType, thrownType, storage, parameters);
420
+		return new FunctionHeader(typeParameters, returnType, thrownType, parameters);
446 421
 	}
447 422
 	
448 423
 	public FunctionParameter getVariadicParameter() {
@@ -508,23 +483,23 @@ public class FunctionHeader {
508 483
 		return parameters[parameters.length - 1].variadic ? Integer.MAX_VALUE : parameters.length;
509 484
 	}
510 485
 	
511
-	private static boolean hasUnknowns(StoredType[] types, StoredType returnType) {
512
-		if (returnType.type == BasicTypeID.UNDETERMINED)
486
+	private static boolean hasUnknowns(TypeID[] types, TypeID returnType) {
487
+		if (returnType == BasicTypeID.UNDETERMINED)
513 488
 			return true;
514 489
 		
515
-		for (StoredType type : types)
516
-			if (type.type == BasicTypeID.UNDETERMINED)
490
+		for (TypeID type : types)
491
+			if (type == BasicTypeID.UNDETERMINED)
517 492
 				return true;
518 493
 		
519 494
 		return false;
520 495
 	}
521 496
 	
522
-	private static boolean hasUnknowns(FunctionParameter[] parameters, StoredType returnType) {
523
-		if (returnType.type == BasicTypeID.UNDETERMINED)
497
+	private static boolean hasUnknowns(FunctionParameter[] parameters, TypeID returnType) {
498
+		if (returnType == BasicTypeID.UNDETERMINED)
524 499
 			return true;
525 500
 		
526 501
 		for (FunctionParameter parameter : parameters)
527
-			if (parameter.type.type == BasicTypeID.UNDETERMINED)
502
+			if (parameter.type == BasicTypeID.UNDETERMINED)
528 503
 				return true;
529 504
 		
530 505
 		return false;
@@ -555,10 +530,8 @@ public class FunctionHeader {
555 530
             return false;
556 531
         if(!Arrays.equals(parameters, that.parameters))
557 532
             return false;
558
-        if(!Objects.equals(thrownType, that.thrownType))
559
-            return false;
560
-        return Objects.equals(storage, that.storage);
561
-    }
533
+		return thrownType == that.thrownType;
534
+	}
562 535
     
563 536
     @Override
564 537
     public int hashCode() {
@@ -566,7 +539,6 @@ public class FunctionHeader {
566 539
         result = 31 * result + returnType.hashCode();
567 540
         result = 31 * result + Arrays.hashCode(parameters);
568 541
         result = 31 * result + (thrownType != null ? thrownType.hashCode() : 0);
569
-        result = 31 * result + (storage != null ? storage.hashCode() : 0);
570 542
         result = 31 * result + minParameters;
571 543
         result = 31 * result + maxParameters;
572 544
         result = 31 * result + (hasUnknowns ? 1 : 0);

+ 6
- 11
CodeModel/src/main/java/org/openzen/zenscript/codemodel/FunctionParameter.java View File

@@ -8,10 +8,9 @@ package org.openzen.zenscript.codemodel;
8 8
 import java.util.Objects;
9 9
 import org.openzen.zencode.shared.Taggable;
10 10
 import org.openzen.zenscript.codemodel.expression.Expression;
11
-import org.openzen.zenscript.codemodel.type.BasicTypeID;
12 11
 import org.openzen.zenscript.codemodel.type.GlobalTypeRegistry;
13
-import org.openzen.zenscript.codemodel.type.StoredType;
14 12
 import org.openzen.zenscript.codemodel.annotations.ParameterAnnotation;
13
+import org.openzen.zenscript.codemodel.type.TypeID;
15 14
 
16 15
 /**
17 16
  *
@@ -21,12 +20,12 @@ public class FunctionParameter extends Taggable {
21 20
 	public static final FunctionParameter[] NONE = new FunctionParameter[0];
22 21
 	
23 22
 	public ParameterAnnotation[] annotations;
24
-	public final StoredType type;
23
+	public final TypeID type;
25 24
 	public final String name;
26 25
 	public Expression defaultValue;
27 26
 	public final boolean variadic;
28 27
 	
29
-	public FunctionParameter(StoredType type) {
28
+	public FunctionParameter(TypeID type) {
30 29
 		this.annotations = ParameterAnnotation.NONE;
31 30
 		this.type = type;
32 31
 		this.name = "";
@@ -34,11 +33,7 @@ public class FunctionParameter extends Taggable {
34 33
 		this.variadic = false;
35 34
 	}
36 35
 	
37
-	public FunctionParameter(BasicTypeID type) {
38
-		this(type.stored);
39
-	}
40
-	
41
-	public FunctionParameter(StoredType type, String name) {
36
+	public FunctionParameter(TypeID type, String name) {
42 37
 		this.annotations = ParameterAnnotation.NONE;
43 38
 		this.type = type;
44 39
 		this.name = name;
@@ -46,7 +41,7 @@ public class FunctionParameter extends Taggable {
46 41
 		this.variadic = false;
47 42
 	}
48 43
 	
49
-	public FunctionParameter(StoredType type, String name, Expression defaultValue, boolean variadic) {
44
+	public FunctionParameter(TypeID type, String name, Expression defaultValue, boolean variadic) {
50 45
 		this.annotations = ParameterAnnotation.NONE;
51 46
 		this.type = type;
52 47
 		this.name = name;
@@ -61,7 +56,7 @@ public class FunctionParameter extends Taggable {
61 56
 	}
62 57
 	
63 58
 	public FunctionParameter withGenericArguments(GenericMapper mapper) {
64
-		StoredType instanced = type.instance(mapper);
59
+		TypeID instanced = type.instance(mapper);
65 60
 		if (instanced.equals(type))
66 61
 			return this;
67 62
 		

+ 14
- 14
CodeModel/src/main/java/org/openzen/zenscript/codemodel/GenericMapper.java View File

@@ -21,9 +21,9 @@ public class GenericMapper {
21 21
     
22 22
     public final CodePosition position;
23 23
     public final GlobalTypeRegistry registry;
24
-    private final Map<TypeParameter, StoredType> mapping;
24
+    private final Map<TypeParameter, TypeID> mapping;
25 25
     
26
-    public GenericMapper(CodePosition position, GlobalTypeRegistry registry, Map<TypeParameter, StoredType> mapping) {
26
+    public GenericMapper(CodePosition position, GlobalTypeRegistry registry, Map<TypeParameter, TypeID> mapping) {
27 27
         if(mapping == null)
28 28
             throw new IllegalArgumentException();
29 29
         
@@ -32,40 +32,40 @@ public class GenericMapper {
32 32
         this.mapping = mapping;
33 33
     }
34 34
     
35
-    public Map<TypeParameter, StoredType> getMapping() {
35
+    public Map<TypeParameter, TypeID> getMapping() {
36 36
         return mapping;
37 37
     }
38 38
     
39
-    public StoredType map(StoredType original) {
39
+    public TypeID map(TypeID original) {
40 40
         return mapping.isEmpty() ? original : original.instance(this);
41 41
     }
42 42
     
43
-    public StoredType[] map(StoredType[] original) {
43
+    public TypeID[] map(TypeID[] original) {
44 44
         if(mapping.isEmpty() || original.length == 0)
45 45
             return original;
46 46
         
47
-        StoredType[] mapped = new StoredType[original.length];
47
+        TypeID[] mapped = new TypeID[original.length];
48 48
         for(int i = 0; i < original.length; i++)
49 49
             mapped[i] = original[i].instance(this);
50 50
         return mapped;
51 51
     }
52 52
     
53
-    public StoredType map(GenericTypeID type) {
53
+    public TypeID mapGeneric(GenericTypeID type) {
54 54
         //if (!mapping.containsKey(type.parameter))
55 55
         //	throw new IllegalStateException("No mapping found for type " + type);
56 56
         
57
-        return mapping.containsKey(type.parameter) ? mapping.get(type.parameter) : type.stored();
57
+        return mapping.getOrDefault(type.parameter, type);
58 58
     }
59 59
     
60 60
     public FunctionHeader map(FunctionHeader original) {
61 61
         return mapping.isEmpty() ? original : original.withGenericArguments(this);
62 62
     }
63 63
     
64
-    public GenericMapper getInner(CodePosition position, GlobalTypeRegistry registry, Map<TypeParameter, StoredType> mapping) {
65
-        Map<TypeParameter, StoredType> resultMap = new HashMap<>(this.mapping);
64
+    public GenericMapper getInner(CodePosition position, GlobalTypeRegistry registry, Map<TypeParameter, TypeID> mapping) {
65
+        Map<TypeParameter, TypeID> resultMap = new HashMap<>(this.mapping);
66 66
         mapping.forEach((typeParameter, storedType) -> {
67 67
             if(resultMap.containsKey(typeParameter)) {
68
-                if(storedType.type instanceof GenericTypeID && ((GenericTypeID) storedType.type).parameter == typeParameter) {
68
+                if(storedType instanceof GenericTypeID && ((GenericTypeID) storedType).parameter == typeParameter) {
69 69
                     return;
70 70
                 }
71 71
             }
@@ -76,9 +76,9 @@ public class GenericMapper {
76 76
     }
77 77
     
78 78
     public GenericMapper getInner(CodePosition position, GlobalTypeRegistry registry, TypeParameter[] parameters) {
79
-        Map<TypeParameter, StoredType> resultMap = new HashMap<>(this.mapping);
79
+        Map<TypeParameter, TypeID> resultMap = new HashMap<>(this.mapping);
80 80
         for(TypeParameter parameter : parameters)
81
-            resultMap.put(parameter, new StoredType(registry.getGeneric(parameter), null));
81
+            resultMap.put(parameter, registry.getGeneric(parameter));
82 82
         return new GenericMapper(position, registry, resultMap);
83 83
     }
84 84
     
@@ -90,7 +90,7 @@ public class GenericMapper {
90 90
         StringBuilder result = new StringBuilder();
91 91
         result.append('{');
92 92
         boolean first = true;
93
-        for(Map.Entry<TypeParameter, StoredType> entry : mapping.entrySet()) {
93
+        for(Map.Entry<TypeParameter, TypeID> entry : mapping.entrySet()) {
94 94
             if(first) {
95 95
                 first = false;
96 96
             } else {

+ 3
- 4
CodeModel/src/main/java/org/openzen/zenscript/codemodel/GenericName.java View File

@@ -8,7 +8,6 @@ package org.openzen.zenscript.codemodel;
8 8
 import java.util.List;
9 9
 import org.openzen.zenscript.codemodel.type.DefinitionTypeID;
10 10
 import org.openzen.zenscript.codemodel.type.GlobalTypeRegistry;
11
-import org.openzen.zenscript.codemodel.type.StoredType;
12 11
 import org.openzen.zenscript.codemodel.type.TypeID;
13 12
 
14 13
 /**
@@ -17,13 +16,13 @@ import org.openzen.zenscript.codemodel.type.TypeID;
17 16
  */
18 17
 public class GenericName {
19 18
 	public final String name;
20
-	public final StoredType[] arguments;
19
+	public final TypeID[] arguments;
21 20
 	
22 21
 	public GenericName(String name) {
23
-		this(name, StoredType.NONE);
22
+		this(name, TypeID.NONE);
24 23
 	}
25 24
 	
26
-	public GenericName(String name, StoredType[] arguments) {
25
+	public GenericName(String name, TypeID[] arguments) {
27 26
 		if (arguments == null)
28 27
 			throw new NullPointerException("Arguments cannot be null");
29 28
 		

+ 1
- 42
CodeModel/src/main/java/org/openzen/zenscript/codemodel/HighLevelDefinition.java View File

@@ -46,9 +46,7 @@ public abstract class HighLevelDefinition extends Taggable {
46 46
 	
47 47
 	public HighLevelDefinition outerDefinition;
48 48
 	private TypeID superType;
49
-	
50
-	private boolean isDestructible = false;
51
-	
49
+
52 50
 	public HighLevelDefinition(CodePosition position, Module module, ZSPackage pkg, String name, int modifiers, HighLevelDefinition outerDefinition) {
53 51
 		if (module == null)
54 52
 			throw new NullPointerException();
@@ -74,8 +72,6 @@ public abstract class HighLevelDefinition extends Taggable {
74 72
 	
75 73
 	public void setSuperType(TypeID superType) {
76 74
 		this.superType = superType;
77
-		if (outerDefinition != null)
78
-			isDestructible |= outerDefinition.isDestructible;
79 75
 	}
80 76
 	
81 77
 	public boolean isSubclassOf(HighLevelDefinition other) {
@@ -122,34 +118,6 @@ public abstract class HighLevelDefinition extends Taggable {
122 118
 			collector.member(member);
123 119
 	}
124 120
 	
125
-	public boolean isDestructible() {
126
-		Set<HighLevelDefinition> scanning = new HashSet<>();
127
-		return isDestructible(scanning);
128
-	}
129
-	
130
-	public boolean isDestructible(Set<HighLevelDefinition> scanning) {
131
-		if (scanning.contains(this))
132
-			return false;
133
-		
134
-		scanning.add(this);
135
-		
136
-		boolean isDestructible = false;
137
-		for (IDefinitionMember member : members) {
138
-			if (member instanceof DestructorMember)
139
-				isDestructible = true;
140
-			if (member instanceof FieldMember) {
141
-				FieldMember field = (FieldMember)member;
142
-				if (field.getType().isDestructible(scanning))
143
-					isDestructible = true;
144
-			}
145
-			if ((member instanceof ImplementationMember) && ((ImplementationMember)member).type.isDestructible())
146
-				isDestructible = true;
147
-		}
148
-		
149
-		scanning.remove(this);
150
-		return isDestructible;
151
-	}
152
-	
153 121
 	public void setTypeParameters(TypeParameter[] typeParameters) {
154 122
 		this.typeParameters = typeParameters;
155 123
 	}
@@ -183,24 +151,15 @@ public abstract class HighLevelDefinition extends Taggable {
183 151
 	}
184 152
 	
185 153
 	public void normalize(TypeScope scope) {
186
-		DestructorMember destructor = null;
187 154
 		List<FieldMember> fields = new ArrayList<>();
188 155
 		
189 156
 		for (IDefinitionMember member : members) {
190 157
 			member.normalize(scope);
191 158
 			
192
-			if (member instanceof DestructorMember)
193
-				destructor = (DestructorMember)member;
194 159
 			if (member instanceof FieldMember)
195 160
 				fields.add((FieldMember)member);
196 161
 		}
197 162
 		
198
-		if (isDestructible() && destructor == null && !(this instanceof ExpansionDefinition)) {
199
-			//System.out.println("Added destructor to " + position);
200
-			destructor = new DestructorMember(position, this, Modifiers.PUBLIC);
201
-			members.add(destructor);
202
-		}
203
-		
204 163
 		for (FieldMember field : fields) {
205 164
 			if (field.autoGetter != null)
206 165
 				members.add(field.autoGetter);

+ 1
- 8
CodeModel/src/main/java/org/openzen/zenscript/codemodel/ModuleSpace.java View File

@@ -19,7 +19,6 @@ import org.openzen.zenscript.codemodel.definition.ExpansionDefinition;
19 19
 import org.openzen.zenscript.codemodel.definition.ZSPackage;
20 20
 import org.openzen.zenscript.codemodel.type.GlobalTypeRegistry;
21 21
 import org.openzen.zenscript.codemodel.type.ISymbol;
22
-import org.openzen.zenscript.codemodel.type.storage.StorageType;
23 22
 
24 23
 /**
25 24
  *
@@ -32,16 +31,14 @@ public final class ModuleSpace {
32 31
 	private final List<ExpansionDefinition> expansions = new ArrayList<>();
33 32
 	private final Map<String, ISymbol> globals = new HashMap<>();
34 33
 	private final AnnotationDefinition[] annotations;
35
-	private final StorageType[] storageTypes;
36 34
 	private final Map<String, SemanticModule> modules = new HashMap<>();
37 35
 	
38
-	public ModuleSpace(GlobalTypeRegistry registry, List<AnnotationDefinition> annotations, StorageType[] storageTypes) {
36
+	public ModuleSpace(GlobalTypeRegistry registry, List<AnnotationDefinition> annotations) {
39 37
 		this.registry = registry;
40 38
 		
41 39
 		annotations.add(NativeAnnotationDefinition.INSTANCE);
42 40
 		annotations.add(PreconditionAnnotationDefinition.INSTANCE);
43 41
 		this.annotations = annotations.toArray(new AnnotationDefinition[annotations.size()]);
44
-		this.storageTypes = storageTypes;
45 42
 	}
46 43
 	
47 44
 	public void addModule(String name, SemanticModule dependency) throws CompileException {
@@ -80,8 +77,4 @@ public final class ModuleSpace {
80 77
 	public AnnotationDefinition[] getAnnotations() {
81 78
 		return annotations;
82 79
 	}
83
-	
84
-	public StorageType[] getStorageTypes() {
85
-		return storageTypes;
86
-	}
87 80
 }

+ 1
- 6
CodeModel/src/main/java/org/openzen/zenscript/codemodel/SemanticModule.java View File

@@ -20,7 +20,6 @@ import org.openzen.zenscript.codemodel.definition.ZSPackage;
20 20
 import org.openzen.zenscript.codemodel.scope.FileScope;
21 21
 import org.openzen.zenscript.codemodel.type.GlobalTypeRegistry;
22 22
 import org.openzen.zenscript.codemodel.type.ISymbol;
23
-import org.openzen.zenscript.codemodel.type.storage.StorageType;
24 23
 
25 24
 /**
26 25
  *
@@ -44,7 +43,6 @@ public class SemanticModule {
44 43
 	public final GlobalTypeRegistry registry;
45 44
 	public final List<ExpansionDefinition> expansions;
46 45
 	public final AnnotationDefinition[] annotations;
47
-	public final StorageType[] storageTypes;
48 46
 	public final IZSLogger logger;
49 47
 	
50 48
 	public SemanticModule(
@@ -59,7 +57,6 @@ public class SemanticModule {
59 57
             GlobalTypeRegistry registry,
60 58
             List<ExpansionDefinition> expansions,
61 59
             AnnotationDefinition[] annotations,
62
-            StorageType[] storageTypes,
63 60
             IZSLogger logger)
64 61
 	{
65 62
 		this.name = module.name;
@@ -76,7 +73,6 @@ public class SemanticModule {
76 73
 		this.registry = registry;
77 74
 		this.expansions = expansions;
78 75
 		this.annotations = annotations;
79
-		this.storageTypes = storageTypes;
80 76
         this.logger = logger;
81 77
     }
82 78
 	
@@ -88,7 +84,7 @@ public class SemanticModule {
88 84
 		if (state != State.ASSEMBLED)
89 85
 			throw new IllegalStateException("Module is invalid");
90 86
 		
91
-		ModuleTypeResolutionContext context = new ModuleTypeResolutionContext(registry, annotations, storageTypes, rootPackage, null, globals);
87
+		ModuleTypeResolutionContext context = new ModuleTypeResolutionContext(registry, annotations, rootPackage, null, globals);
92 88
 		AnnotationProcessor annotationProcessor = new AnnotationProcessor(context, expansions);
93 89
 		List<ScriptBlock> processedScripts = new ArrayList<>();
94 90
 		FileScope fileScope = new FileScope(context, expansions, globals, member -> {});
@@ -113,7 +109,6 @@ public class SemanticModule {
113 109
 				registry,
114 110
 				expansions,
115 111
 				annotations,
116
-				storageTypes,
117 112
                 logger);
118 113
 	}
119 114
 	

+ 1
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/annotations/NativeAnnotationDefinition.java View File

@@ -20,7 +20,6 @@ import org.openzen.zenscript.codemodel.scope.StatementScope;
20 20
 import org.openzen.zenscript.codemodel.serialization.CodeSerializationInput;
21 21
 import org.openzen.zenscript.codemodel.statement.Statement;
22 22
 import org.openzen.zenscript.codemodel.type.BasicTypeID;
23
-import org.openzen.zenscript.codemodel.type.StringTypeID;
24 23
 
25 24
 import java.util.Collections;
26 25
 import java.util.List;
@@ -33,7 +32,7 @@ public class NativeAnnotationDefinition implements AnnotationDefinition {
33 32
 	public static final NativeAnnotationDefinition INSTANCE = new NativeAnnotationDefinition();
34 33
 	
35 34
 	private final List<FunctionHeader> INITIALIZERS = Collections.singletonList(
36
-			new FunctionHeader(BasicTypeID.VOID, StringTypeID.UNIQUE));
35
+			new FunctionHeader(BasicTypeID.VOID, BasicTypeID.STRING));
37 36
 	
38 37
 	private NativeAnnotationDefinition() {}
39 38
 

+ 4
- 6
CodeModel/src/main/java/org/openzen/zenscript/codemodel/annotations/PreconditionAnnotationDefinition.java View File

@@ -27,8 +27,6 @@ import org.openzen.zenscript.codemodel.serialization.CodeSerializationInput;
27 27
 import org.openzen.zenscript.codemodel.statement.Statement;
28 28
 import org.openzen.zenscript.codemodel.type.BasicTypeID;
29 29
 import org.openzen.zenscript.codemodel.GenericName;
30
-import org.openzen.zenscript.codemodel.type.StringTypeID;
31
-import org.openzen.zenscript.codemodel.type.storage.ValueStorageTag;
32 30
 
33 31
 /**
34 32
  *
@@ -51,10 +49,10 @@ public class PreconditionAnnotationDefinition implements AnnotationDefinition {
51 49
 	@Override
52 50
 	public List<FunctionHeader> getInitializers(BaseScope scope) {
53 51
 		return Collections.singletonList(new FunctionHeader(
54
-				BasicTypeID.VOID.stored,
55
-				scope.getType(CodePosition.BUILTIN, enforcementLevelName).stored(),
56
-				BasicTypeID.BOOL.stored,
57
-				StringTypeID.UNIQUE));
52
+				BasicTypeID.VOID,
53
+				scope.getType(CodePosition.BUILTIN, enforcementLevelName),
54
+				BasicTypeID.BOOL,
55
+				BasicTypeID.STRING));
58 56
 	}
59 57
 
60 58
 	@Override

+ 1
- 1
CodeModel/src/main/java/org/openzen/zenscript/codemodel/annotations/PreconditionForMethod.java View File

@@ -90,7 +90,7 @@ public class PreconditionForMethod implements MemberAnnotation {
90 90
 			Expression inverseCondition = members.getGroup(OperatorType.NOT)
91 91
 					.call(position, scope, condition, CallArguments.EMPTY, false);
92 92
 
93
-			Statement throwStatement = new ExpressionStatement(position, new PanicExpression(position, BasicTypeID.VOID.stored, message));
93
+			Statement throwStatement = new ExpressionStatement(position, new PanicExpression(position, BasicTypeID.VOID, message));
94 94
 			List<Statement> statements = new ArrayList<>();
95 95
 			statements.add(new IfStatement(position, inverseCondition, throwStatement, null));
96 96
 

+ 1
- 8
CodeModel/src/main/java/org/openzen/zenscript/codemodel/context/FileResolutionContext.java View File

@@ -16,9 +16,7 @@ import org.openzen.zenscript.codemodel.GenericName;
16 16
 import org.openzen.zenscript.codemodel.definition.ZSPackage;
17 17
 import org.openzen.zenscript.codemodel.type.GlobalTypeRegistry;
18 18
 import org.openzen.zenscript.codemodel.type.InvalidTypeID;
19
-import org.openzen.zenscript.codemodel.type.StoredType;
20 19
 import org.openzen.zenscript.codemodel.type.TypeID;
21
-import org.openzen.zenscript.codemodel.type.storage.StorageTag;
22 20
 
23 21
 /**
24 22
  *
@@ -80,14 +78,9 @@ public class FileResolutionContext implements TypeResolutionContext {
80 78
 		
81 79
 		return module.getType(position, name);
82 80
 	}
83
-	
84
-	@Override
85
-	public StorageTag getStorageTag(CodePosition position, String name, String[] arguments) {
86
-		return module.getStorageTag(position, name, arguments);
87
-	}
88 81
 
89 82
 	@Override
90
-	public StoredType getThisType() {
83
+	public TypeID getThisType() {
91 84
 		return null;
92 85
 	}
93 86
 }

+ 2
- 11
CodeModel/src/main/java/org/openzen/zenscript/codemodel/context/LocalTypeResolutionContext.java View File

@@ -13,10 +13,7 @@ import org.openzen.zenscript.codemodel.type.DefinitionTypeID;
13 13
 import org.openzen.zenscript.codemodel.GenericName;
14 14
 import org.openzen.zenscript.codemodel.definition.ZSPackage;
15 15
 import org.openzen.zenscript.codemodel.type.GlobalTypeRegistry;
16
-import org.openzen.zenscript.codemodel.type.StoredType;
17 16
 import org.openzen.zenscript.codemodel.type.TypeID;
18
-import org.openzen.zenscript.codemodel.type.storage.BorrowStorageTag;
19
-import org.openzen.zenscript.codemodel.type.storage.StorageTag;
20 17
 
21 18
 /**
22 19
  *
@@ -66,18 +63,12 @@ public class LocalTypeResolutionContext implements TypeResolutionContext {
66 63
 		
67 64
 		return outer.getType(position, name);
68 65
 	}
69
-
70
-	@Override
71
-	public StorageTag getStorageTag(CodePosition position, String name, String[] parameters) {
72
-		return outer.getStorageTag(position, name, parameters);
73
-	}
74 66
 	
75 67
 	@Override
76
-	public StoredType getThisType() {
68
+	public TypeID getThisType() {
77 69
 		if (type == null)
78 70
 			return null;
79 71
 		
80
-		TypeID self = getTypeRegistry().getForMyDefinition(type.load());
81
-		return self.stored(BorrowStorageTag.THIS);
72
+		return getTypeRegistry().getForMyDefinition(type.load());
82 73
 	}
83 74
 }

+ 1
- 18
CodeModel/src/main/java/org/openzen/zenscript/codemodel/context/ModuleTypeResolutionContext.java View File

@@ -9,17 +9,12 @@ import java.util.HashMap;
9 9
 import java.util.List;
10 10
 import java.util.Map;
11 11
 import org.openzen.zencode.shared.CodePosition;
12
-import org.openzen.zencode.shared.CompileExceptionCode;
13 12
 import org.openzen.zenscript.codemodel.annotations.AnnotationDefinition;
14 13
 import org.openzen.zenscript.codemodel.definition.ZSPackage;
15 14
 import org.openzen.zenscript.codemodel.GenericName;
16 15
 import org.openzen.zenscript.codemodel.type.GlobalTypeRegistry;
17 16
 import org.openzen.zenscript.codemodel.type.ISymbol;
18
-import org.openzen.zenscript.codemodel.type.StoredType;
19 17
 import org.openzen.zenscript.codemodel.type.TypeID;
20
-import org.openzen.zenscript.codemodel.type.storage.InvalidStorageTag;
21
-import org.openzen.zenscript.codemodel.type.storage.StorageTag;
22
-import org.openzen.zenscript.codemodel.type.storage.StorageType;
23 18
 
24 19
 /**
25 20
  *
@@ -28,7 +23,6 @@ import org.openzen.zenscript.codemodel.type.storage.StorageType;
28 23
 public class ModuleTypeResolutionContext implements TypeResolutionContext {
29 24
 	private final GlobalTypeRegistry registry;
30 25
 	private final Map<String, AnnotationDefinition> annotations = new HashMap<>();
31
-	private final Map<String, StorageType> storageTypes = new HashMap<>();
32 26
 	private final Map<String, ISymbol> globals;
33 27
 	private final ZSPackage rootPackage;
34 28
 	
@@ -37,7 +31,6 @@ public class ModuleTypeResolutionContext implements TypeResolutionContext {
37 31
 	public ModuleTypeResolutionContext(
38 32
 			GlobalTypeRegistry registry,
39 33
 			AnnotationDefinition[] annotations,
40
-			StorageType[] storageTypes,
41 34
 			ZSPackage rootPackage,
42 35
 			CompilingPackage rootCompiling,
43 36
 			Map<String, ISymbol> globals)
@@ -49,8 +42,6 @@ public class ModuleTypeResolutionContext implements TypeResolutionContext {
49 42
 		
50 43
 		for (AnnotationDefinition annotation : annotations)
51 44
 			this.annotations.put(annotation.getAnnotationName(), annotation);
52
-		for (StorageType storageType : storageTypes)
53
-			this.storageTypes.put(storageType.getName(), storageType);
54 45
 	}
55 46
 	
56 47
 	@Override
@@ -83,15 +74,7 @@ public class ModuleTypeResolutionContext implements TypeResolutionContext {
83 74
 	}
84 75
 	
85 76
 	@Override
86
-	public StorageTag getStorageTag(CodePosition position, String name, String[] arguments) {
87
-		if (!storageTypes.containsKey(name))
88
-			return new InvalidStorageTag(position, CompileExceptionCode.NO_SUCH_STORAGE_TYPE, "No such storage type: " + name);
89
-		
90
-		return storageTypes.get(name).instance(position, arguments);
91
-	}
92
-	
93
-	@Override
94
-	public StoredType getThisType() {
77
+	public TypeID getThisType() {
95 78
 		return null;
96 79
 	}
97 80
 }

+ 3
- 3
CodeModel/src/main/java/org/openzen/zenscript/codemodel/context/StatementContext.java View File

@@ -16,7 +16,7 @@ import org.openzen.zenscript.codemodel.expression.switchvalue.VariantOptionSwitc
16 16
 import org.openzen.zenscript.codemodel.generic.TypeParameter;
17 17
 import org.openzen.zenscript.codemodel.statement.LoopStatement;
18 18
 import org.openzen.zenscript.codemodel.statement.VarStatement;
19
-import org.openzen.zenscript.codemodel.type.StoredType;
19
+import org.openzen.zenscript.codemodel.type.TypeID;
20 20
 
21 21
 /**
22 22
  *
@@ -31,7 +31,7 @@ public class StatementContext extends TypeContext {
31 31
 	
32 32
 	public VariantOptionSwitchValue variantOptionSwitchValue;
33 33
 	
34
-	public StatementContext(CodePosition position, ModuleContext module, StoredType thisType) {
34
+	public StatementContext(CodePosition position, ModuleContext module, TypeID thisType) {
35 35
 		super(position, module, TypeParameter.NONE, thisType);
36 36
 		
37 37
 		loops = LoopStatement.NONE;
@@ -40,7 +40,7 @@ public class StatementContext extends TypeContext {
40 40
 		lambdaOuter = null;
41 41
 	}
42 42
 	
43
-	public StatementContext(CodePosition position, ModuleContext module, StoredType thisType, FunctionHeader header) {
43
+	public StatementContext(CodePosition position, ModuleContext module, TypeID thisType, FunctionHeader header) {
44 44
 		super(position, module, header.typeParameters, thisType);
45 45
 		
46 46
 		loops = LoopStatement.NONE;

+ 8
- 8
CodeModel/src/main/java/org/openzen/zenscript/codemodel/context/TypeContext.java View File

@@ -11,7 +11,7 @@ import java.util.Map;
11 11
 import org.openzen.zencode.shared.CodePosition;
12 12
 import org.openzen.zenscript.codemodel.GenericMapper;
13 13
 import org.openzen.zenscript.codemodel.generic.TypeParameter;
14
-import org.openzen.zenscript.codemodel.type.StoredType;
14
+import org.openzen.zenscript.codemodel.type.TypeID;
15 15
 import org.openzen.zenscript.codemodel.type.member.LocalMemberCache;
16 16
 import org.openzen.zenscript.codemodel.type.member.TypeMembers;
17 17
 
@@ -22,11 +22,11 @@ import org.openzen.zenscript.codemodel.type.member.TypeMembers;
22 22
 public class TypeContext {
23 23
 	protected final CodePosition position;
24 24
 	protected final TypeParameter[] typeParameters;
25
-	public final StoredType thisType;
25
+	public final TypeID thisType;
26 26
 	private final LocalMemberCache memberCache;
27 27
 	public final ModuleContext moduleContext;
28 28
 	
29
-	public TypeContext(CodePosition position, ModuleContext context, TypeParameter[] parameters, StoredType thisType) {
29
+	public TypeContext(CodePosition position, ModuleContext context, TypeParameter[] parameters, TypeID thisType) {
30 30
 		this.position = position;
31 31
 		this.typeParameters = parameters;
32 32
 		this.thisType = thisType;
@@ -34,7 +34,7 @@ public class TypeContext {
34 34
 		moduleContext = context;
35 35
 	}
36 36
 	
37
-	public TypeContext(CodePosition position, TypeContext outer, StoredType thisType, TypeParameter... inner) {
37
+	public TypeContext(CodePosition position, TypeContext outer, TypeID thisType, TypeParameter... inner) {
38 38
 		this.position = position;
39 39
 		typeParameters = concat(outer.typeParameters, inner);
40 40
 		this.thisType = thisType;
@@ -42,8 +42,8 @@ public class TypeContext {
42 42
 		memberCache = new LocalMemberCache(moduleContext.registry, moduleContext.expansions);
43 43
 	}
44 44
 	
45
-	public TypeContext(CodePosition position, TypeContext outer, StoredType thisType, List<TypeParameter> inner) {
46
-		this(position, outer, thisType, inner.toArray(new TypeParameter[inner.size()]));
45
+	public TypeContext(CodePosition position, TypeContext outer, TypeID thisType, List<TypeParameter> inner) {
46
+		this(position, outer, thisType, inner.toArray(TypeParameter.NONE));
47 47
 	}
48 48
 	
49 49
 	public int getId(TypeParameter parameter) {
@@ -58,12 +58,12 @@ public class TypeContext {
58 58
 		return typeParameters[index];
59 59
 	}
60 60
 	
61
-	public TypeMembers getTypeMembers(StoredType type) {
61
+	public TypeMembers getTypeMembers(TypeID type) {
62 62
 		return memberCache.get(type);
63 63
 	}
64 64
 	
65 65
 	public GenericMapper getMapper() {
66
-		Map<TypeParameter, StoredType> mapper = StoredType.getSelfMapping(moduleContext.registry, typeParameters);
66
+		Map<TypeParameter, TypeID> mapper = TypeID.getSelfMapping(moduleContext.registry, typeParameters);
67 67
 		return new GenericMapper(position, moduleContext.registry, mapper);
68 68
 	}
69 69
 	

+ 2
- 6
CodeModel/src/main/java/org/openzen/zenscript/codemodel/context/TypeResolutionContext.java View File

@@ -11,9 +11,7 @@ import org.openzen.zenscript.codemodel.annotations.AnnotationDefinition;
11 11
 import org.openzen.zenscript.codemodel.GenericName;
12 12
 import org.openzen.zenscript.codemodel.definition.ZSPackage;
13 13
 import org.openzen.zenscript.codemodel.type.GlobalTypeRegistry;
14
-import org.openzen.zenscript.codemodel.type.StoredType;
15 14
 import org.openzen.zenscript.codemodel.type.TypeID;
16
-import org.openzen.zenscript.codemodel.type.storage.StorageTag;
17 15
 
18 16
 /**
19 17
  *
@@ -27,8 +25,6 @@ public interface TypeResolutionContext {
27 25
 	AnnotationDefinition getAnnotation(String name);
28 26
 	
29 27
 	TypeID getType(CodePosition position, List<GenericName> name);
30
-	
31
-	StorageTag getStorageTag(CodePosition position, String name, String[] parameters);
32
-	
33
-	StoredType getThisType();
28
+
29
+	TypeID getThisType();
34 30
 }

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/definition/ExpansionDefinition.java View File

@@ -8,14 +8,14 @@ package org.openzen.zenscript.codemodel.definition;
8 8
 import org.openzen.zencode.shared.CodePosition;
9 9
 import org.openzen.zenscript.codemodel.HighLevelDefinition;
10 10
 import org.openzen.zenscript.codemodel.Module;
11
-import org.openzen.zenscript.codemodel.type.StoredType;
11
+import org.openzen.zenscript.codemodel.type.TypeID;
12 12
 
13 13
 /**
14 14
  *
15 15
  * @author Hoofdgebruiker
16 16
  */
17 17
 public class ExpansionDefinition extends HighLevelDefinition {
18
-	public StoredType target;
18
+	public TypeID target;
19 19
 	
20 20
 	public ExpansionDefinition(CodePosition position, Module module, ZSPackage pkg, int modifiers, HighLevelDefinition outerDefinition) {
21 21
 		super(position, module, pkg, null, modifiers, outerDefinition);

+ 1
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/definition/FunctionDefinition.java View File

@@ -17,7 +17,6 @@ import org.openzen.zenscript.codemodel.statement.Statement;
17 17
 import org.openzen.zenscript.codemodel.type.GlobalTypeRegistry;
18 18
 import org.openzen.zenscript.codemodel.type.member.TypeMemberGroup;
19 19
 import org.openzen.zenscript.codemodel.type.member.TypeMemberPriority;
20
-import org.openzen.zenscript.codemodel.type.storage.StaticStorageTag;
21 20
 
22 21
 /**
23 22
  *
@@ -41,7 +40,7 @@ public class FunctionDefinition extends HighLevelDefinition {
41 40
 	public void setHeader(GlobalTypeRegistry registry, FunctionHeader header) {
42 41
 		this.header = header;
43 42
 		addMember(caller = new CallerMember(position, this, Modifiers.PUBLIC | Modifiers.STATIC, header, null));
44
-		callerGroup.addMethod(new FunctionalMemberRef(caller, registry.getFunction(header).stored(StaticStorageTag.INSTANCE), GenericMapper.EMPTY), TypeMemberPriority.SPECIFIED);
43
+		callerGroup.addMethod(new FunctionalMemberRef(caller, registry.getFunction(header), GenericMapper.EMPTY), TypeMemberPriority.SPECIFIED);
45 44
 	}
46 45
 	
47 46
 	public void setCode(Statement statement) {

+ 0
- 9
CodeModel/src/main/java/org/openzen/zenscript/codemodel/definition/InterfaceDefinition.java View File

@@ -27,15 +27,6 @@ public class InterfaceDefinition extends HighLevelDefinition {
27 27
 		baseInterfaces.add(baseInterface);
28 28
 	}
29 29
 	
30
-	@Override
31
-	public boolean isDestructible() {
32
-		for (TypeID baseInterface : baseInterfaces)
33
-			if (baseInterface.isDestructible())
34
-				return true;
35
-		
36
-		return super.isDestructible();
37
-	}
38
-	
39 30
 	@Override
40 31
 	public boolean isStatic() {
41 32
 		return true;

+ 4
- 4
CodeModel/src/main/java/org/openzen/zenscript/codemodel/definition/VariantDefinition.java View File

@@ -13,7 +13,7 @@ import org.openzen.zenscript.codemodel.GenericMapper;
13 13
 import org.openzen.zenscript.codemodel.HighLevelDefinition;
14 14
 import org.openzen.zenscript.codemodel.Module;
15 15
 import org.openzen.zenscript.codemodel.member.ref.VariantOptionRef;
16
-import org.openzen.zenscript.codemodel.type.StoredType;
16
+import org.openzen.zenscript.codemodel.type.TypeID;
17 17
 
18 18
 /**
19 19
  *
@@ -49,9 +49,9 @@ public class VariantDefinition extends HighLevelDefinition {
49 49
 		public final VariantDefinition variant;
50 50
 		public final String name;
51 51
 		public final int ordinal;
52
-		public final StoredType[] types;
52
+		public final TypeID[] types;
53 53
 		
54
-		public Option(CodePosition position, VariantDefinition variant, String name, int ordinal, StoredType[] types) {
54
+		public Option(CodePosition position, VariantDefinition variant, String name, int ordinal, TypeID[] types) {
55 55
 			this.position = position;
56 56
 			this.variant = variant;
57 57
 			this.name = name;
@@ -59,7 +59,7 @@ public class VariantDefinition extends HighLevelDefinition {
59 59
 			this.types = types;
60 60
 		}
61 61
 		
62
-		public VariantOptionRef instance(StoredType variantType, GenericMapper mapper) {
62
+		public VariantOptionRef instance(TypeID variantType, GenericMapper mapper) {
63 63
 			return new VariantOptionRef(this, variantType, mapper.map(types));
64 64
 		}
65 65
 	}

+ 1
- 1
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/AndAndExpression.java View File

@@ -18,7 +18,7 @@ public class AndAndExpression extends Expression {
18 18
 	public final Expression right;
19 19
 	
20 20
 	public AndAndExpression(CodePosition position, Expression left, Expression right) {
21
-		super(position, BasicTypeID.BOOL.stored, binaryThrow(position, left.thrownType, right.thrownType));
21
+		super(position, BasicTypeID.BOOL, binaryThrow(position, left.thrownType, right.thrownType));
22 22
 		
23 23
 		this.left = left;
24 24
 		this.right = right;

+ 3
- 3
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ArrayExpression.java View File

@@ -8,7 +8,7 @@ package org.openzen.zenscript.codemodel.expression;
8 8
 import org.openzen.zencode.shared.CodePosition;
9 9
 import org.openzen.zenscript.codemodel.scope.TypeScope;
10 10
 import org.openzen.zenscript.codemodel.type.ArrayTypeID;
11
-import org.openzen.zenscript.codemodel.type.StoredType;
11
+import org.openzen.zenscript.codemodel.type.TypeID;
12 12
 
13 13
 /**
14 14
  *
@@ -18,11 +18,11 @@ public class ArrayExpression extends Expression {
18 18
 	public final Expression[] expressions;
19 19
 	public final ArrayTypeID arrayType;
20 20
 	
21
-	public ArrayExpression(CodePosition position, Expression[] expressions, StoredType type) {
21
+	public ArrayExpression(CodePosition position, Expression[] expressions, TypeID type) {
22 22
 		super(position, type, multiThrow(position, expressions));
23 23
 		
24 24
 		this.expressions = expressions;
25
-		this.arrayType = (ArrayTypeID)type.type;
25
+		this.arrayType = (ArrayTypeID)type;
26 26
 	}
27 27
 
28 28
 	@Override

+ 8
- 8
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/CallArguments.java View File

@@ -10,26 +10,26 @@ import org.openzen.zencode.shared.CodePosition;
10 10
 import org.openzen.zencode.shared.CompileExceptionCode;
11 11
 import org.openzen.zenscript.codemodel.*;
12 12
 import org.openzen.zenscript.codemodel.scope.TypeScope;
13
-import org.openzen.zenscript.codemodel.type.*;
13
+import org.openzen.zenscript.codemodel.type.TypeID;
14 14
 
15 15
 /**
16 16
  *
17 17
  * @author Hoofdgebruiker
18 18
  */
19 19
 public class CallArguments {
20
-	public static final CallArguments EMPTY = new CallArguments(new Expression[0]);
20
+	public static final CallArguments EMPTY = new CallArguments(Expression.NONE);
21 21
 	
22
-	public final StoredType[] typeArguments;
22
+	public final TypeID[] typeArguments;
23 23
 	public final Expression[] arguments;
24 24
 	
25 25
 	public CallArguments(Expression... arguments) {
26
-		this.typeArguments = StoredType.NONE;
26
+		this.typeArguments = TypeID.NONE;
27 27
 		this.arguments = arguments;
28 28
 	}
29 29
 	
30
-	public CallArguments(StoredType[] typeArguments, Expression[] arguments) {
30
+	public CallArguments(TypeID[] typeArguments, Expression[] arguments) {
31 31
 		if (typeArguments == null)
32
-			typeArguments = StoredType.NONE;
32
+			typeArguments = TypeID.NONE;
33 33
 		if (arguments == null)
34 34
 			throw new IllegalArgumentException("Arguments cannot be null!");
35 35
 		
@@ -37,8 +37,8 @@ public class CallArguments {
37 37
 		this.arguments = arguments;
38 38
 	}
39 39
 	
40
-	public CallArguments(StoredType... dummy) {
41
-		this.typeArguments = StoredType.NONE;
40
+	public CallArguments(TypeID... dummy) {
41
+		this.typeArguments = TypeID.NONE;
42 42
 		this.arguments = new Expression[dummy.length];
43 43
 		for (int i = 0; i < dummy.length; i++)
44 44
 			arguments[i] = new DummyExpression(dummy[i]);

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/CapturedExpression.java View File

@@ -7,7 +7,7 @@ package org.openzen.zenscript.codemodel.expression;
7 7
 
8 8
 import org.openzen.zencode.shared.CodePosition;
9 9
 import org.openzen.zenscript.codemodel.scope.TypeScope;
10
-import org.openzen.zenscript.codemodel.type.StoredType;
10
+import org.openzen.zenscript.codemodel.type.TypeID;
11 11
 
12 12
 /**
13 13
  *
@@ -16,7 +16,7 @@ import org.openzen.zenscript.codemodel.type.StoredType;
16 16
 public abstract class CapturedExpression extends Expression {
17 17
 	public final LambdaClosure closure;
18 18
 	
19
-	public CapturedExpression(CodePosition position, StoredType type, LambdaClosure closure) {
19
+	public CapturedExpression(CodePosition position, TypeID type, LambdaClosure closure) {
20 20
 		super(position, type, null);
21 21
 		
22 22
 		this.closure = closure;

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/CapturedThisExpression.java View File

@@ -7,14 +7,14 @@ package org.openzen.zenscript.codemodel.expression;
7 7
 
8 8
 import org.openzen.zencode.shared.CodePosition;
9 9
 import org.openzen.zenscript.codemodel.scope.TypeScope;
10
-import org.openzen.zenscript.codemodel.type.StoredType;
10
+import org.openzen.zenscript.codemodel.type.TypeID;
11 11
 
12 12
 /**
13 13
  *
14 14
  * @author Hoofdgebruiker
15 15
  */
16 16
 public class CapturedThisExpression extends CapturedExpression {
17
-	public CapturedThisExpression(CodePosition position, StoredType type, LambdaClosure closure) {
17
+	public CapturedThisExpression(CodePosition position, TypeID type, LambdaClosure closure) {
18 18
 		super(position, type, closure);
19 19
 	}
20 20
 

+ 1
- 1
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/CompareExpression.java View File

@@ -24,7 +24,7 @@ public class CompareExpression extends Expression {
24 24
 	public final CompareType comparison;
25 25
 	
26 26
 	public CompareExpression(CodePosition position, Expression left, Expression right, FunctionalMemberRef operator, CompareType comparison) {
27
-		super(position, BasicTypeID.BOOL.stored, binaryThrow(position, left.thrownType, right.thrownType));
27
+		super(position, BasicTypeID.BOOL, binaryThrow(position, left.thrownType, right.thrownType));
28 28
 		
29 29
 		this.left = left;
30 30
 		this.right = right;

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConditionalExpression.java View File

@@ -7,7 +7,7 @@ package org.openzen.zenscript.codemodel.expression;
7 7
 
8 8
 import org.openzen.zencode.shared.CodePosition;
9 9
 import org.openzen.zenscript.codemodel.scope.TypeScope;
10
-import org.openzen.zenscript.codemodel.type.StoredType;
10
+import org.openzen.zenscript.codemodel.type.TypeID;
11 11
 
12 12
 /**
13 13
  *
@@ -23,7 +23,7 @@ public class ConditionalExpression extends Expression {
23 23
 			Expression condition,
24 24
 			Expression ifThen,
25 25
 			Expression ifElse,
26
-			StoredType type) {
26
+			TypeID type) {
27 27
 		super(position, type, binaryThrow(position, condition.thrownType, binaryThrow(position, ifThen.thrownType, ifElse.thrownType)));
28 28
 		
29 29
 		if (!ifThen.type.equals(ifElse.type))

+ 1
- 1
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantBoolExpression.java View File

@@ -17,7 +17,7 @@ public class ConstantBoolExpression extends Expression {
17 17
 	public final boolean value;
18 18
 	
19 19
 	public ConstantBoolExpression(CodePosition position, boolean value) {
20
-		super(position, BasicTypeID.BOOL.stored, null);
20
+		super(position, BasicTypeID.BOOL, null);
21 21
 		
22 22
 		this.value = value;
23 23
 	}

+ 1
- 1
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantByteExpression.java View File

@@ -17,7 +17,7 @@ public class ConstantByteExpression extends Expression {
17 17
 	public final int value;
18 18
 	
19 19
 	public ConstantByteExpression(CodePosition position, int value) {
20
-		super(position, BasicTypeID.BYTE.stored, null);
20
+		super(position, BasicTypeID.BYTE, null);
21 21
 		
22 22
 		this.value = value;
23 23
 	}

+ 1
- 1
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantCharExpression.java View File

@@ -17,7 +17,7 @@ public class ConstantCharExpression extends Expression {
17 17
 	public final char value;
18 18
 	
19 19
 	public ConstantCharExpression(CodePosition position, char value) {
20
-		super(position, BasicTypeID.CHAR.stored, null);
20
+		super(position, BasicTypeID.CHAR, null);
21 21
 		
22 22
 		this.value = value;
23 23
 	}

+ 1
- 1
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantDoubleExpression.java View File

@@ -17,7 +17,7 @@ public class ConstantDoubleExpression extends Expression {
17 17
 	public final double value;
18 18
 	
19 19
 	public ConstantDoubleExpression(CodePosition position, double value) {
20
-		super(position, BasicTypeID.DOUBLE.stored, null);
20
+		super(position, BasicTypeID.DOUBLE, null);
21 21
 		
22 22
 		this.value = value;
23 23
 	}

+ 1
- 1
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantFloatExpression.java View File

@@ -17,7 +17,7 @@ public class ConstantFloatExpression extends Expression {
17 17
 	public final float value;
18 18
 	
19 19
 	public ConstantFloatExpression(CodePosition position, float value) {
20
-		super(position, BasicTypeID.FLOAT.stored, null);
20
+		super(position, BasicTypeID.FLOAT, null);
21 21
 		
22 22
 		this.value = value;
23 23
 	}

+ 1
- 1
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantIntExpression.java View File

@@ -17,7 +17,7 @@ public class ConstantIntExpression extends Expression {
17 17
 	public final int value;
18 18
 	
19 19
 	public ConstantIntExpression(CodePosition position, int value) {
20
-		super(position, BasicTypeID.INT.stored, null);
20
+		super(position, BasicTypeID.INT, null);
21 21
 		
22 22
 		this.value = value;
23 23
 	}

+ 1
- 1
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantLongExpression.java View File

@@ -18,7 +18,7 @@ public class ConstantLongExpression extends Expression {
18 18
 	public final long value;
19 19
 	
20 20
 	public ConstantLongExpression(CodePosition position, long value) {
21
-		super(position, BasicTypeID.LONG.stored, null);
21
+		super(position, BasicTypeID.LONG, null);
22 22
 		
23 23
 		this.value = value;
24 24
 	}

+ 1
- 1
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantSByteExpression.java View File

@@ -17,7 +17,7 @@ public class ConstantSByteExpression extends Expression {
17 17
 	public final byte value;
18 18
 	
19 19
 	public ConstantSByteExpression(CodePosition position, byte value) {
20
-		super(position, BasicTypeID.SBYTE.stored, null);
20
+		super(position, BasicTypeID.SBYTE, null);
21 21
 		
22 22
 		this.value = value;
23 23
 	}

+ 1
- 1
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantShortExpression.java View File

@@ -17,7 +17,7 @@ public class ConstantShortExpression extends Expression {
17 17
 	public final short value;
18 18
 	
19 19
 	public ConstantShortExpression(CodePosition position, short value) {
20
-		super(position, BasicTypeID.SHORT.stored, null);
20
+		super(position, BasicTypeID.SHORT, null);
21 21
 		
22 22
 		this.value = value;
23 23
 	}

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantStringExpression.java View File

@@ -7,7 +7,7 @@ package org.openzen.zenscript.codemodel.expression;
7 7
 
8 8
 import org.openzen.zencode.shared.CodePosition;
9 9
 import org.openzen.zenscript.codemodel.scope.TypeScope;
10
-import org.openzen.zenscript.codemodel.type.StringTypeID;
10
+import org.openzen.zenscript.codemodel.type.BasicTypeID;
11 11
 
12 12
 /**
13 13
  *
@@ -17,7 +17,7 @@ public class ConstantStringExpression extends Expression {
17 17
 	public final String value;
18 18
 	
19 19
 	public ConstantStringExpression(CodePosition position, String value) {
20
-		super(position, StringTypeID.STATIC, null);
20
+		super(position, BasicTypeID.STRING, null);
21 21
 		
22 22
 		this.value = value;
23 23
 	}

+ 1
- 1
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantUIntExpression.java View File

@@ -17,7 +17,7 @@ public class ConstantUIntExpression extends Expression {
17 17
 	public final int value;
18 18
 	
19 19
 	public ConstantUIntExpression(CodePosition position, int value) {
20
-		super(position, BasicTypeID.UINT.stored, null);
20
+		super(position, BasicTypeID.UINT, null);
21 21
 		
22 22
 		this.value = value;
23 23
 	}

+ 1
- 1
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantULongExpression.java View File

@@ -17,7 +17,7 @@ public class ConstantULongExpression extends Expression {
17 17
 	public final long value;
18 18
 	
19 19
 	public ConstantULongExpression(CodePosition position, long value) {
20
-		super(position, BasicTypeID.ULONG.stored, null);
20
+		super(position, BasicTypeID.ULONG, null);
21 21
 		
22 22
 		this.value = value;
23 23
 	}

+ 1
- 1
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantUShortExpression.java View File

@@ -17,7 +17,7 @@ public class ConstantUShortExpression extends Expression {
17 17
 	public final int value;
18 18
 	
19 19
 	public ConstantUShortExpression(CodePosition position, int value) {
20
-		super(position, BasicTypeID.USHORT.stored, null);
20
+		super(position, BasicTypeID.USHORT, null);
21 21
 		
22 22
 		this.value = value;
23 23
 	}

+ 1
- 1
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstantUSizeExpression.java View File

@@ -17,7 +17,7 @@ public class ConstantUSizeExpression extends Expression {
17 17
 	public final long value;
18 18
 	
19 19
 	public ConstantUSizeExpression(CodePosition position, long value) {
20
-		super(position, BasicTypeID.USIZE.stored, null);
20
+		super(position, BasicTypeID.USIZE, null);
21 21
 		
22 22
 		this.value = value;
23 23
 	}

+ 4
- 4
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstructorSuperCallExpression.java View File

@@ -9,19 +9,19 @@ import org.openzen.zencode.shared.CodePosition;
9 9
 import org.openzen.zenscript.codemodel.member.ref.FunctionalMemberRef;
10 10
 import org.openzen.zenscript.codemodel.scope.TypeScope;
11 11
 import org.openzen.zenscript.codemodel.type.BasicTypeID;
12
-import org.openzen.zenscript.codemodel.type.StoredType;
12
+import org.openzen.zenscript.codemodel.type.TypeID;
13 13
 
14 14
 /**
15 15
  *
16 16
  * @author Hoofdgebruiker
17 17
  */
18 18
 public class ConstructorSuperCallExpression extends Expression {
19
-	public final StoredType objectType;
19
+	public final TypeID objectType;
20 20
 	public final FunctionalMemberRef constructor;
21 21
 	public final CallArguments arguments;
22 22
 	
23
-	public ConstructorSuperCallExpression(CodePosition position, StoredType type, FunctionalMemberRef constructor, CallArguments arguments) {
24
-		super(position, BasicTypeID.VOID.stored, binaryThrow(position, constructor.getHeader().thrownType, multiThrow(position, arguments.arguments)));
23
+	public ConstructorSuperCallExpression(CodePosition position, TypeID type, FunctionalMemberRef constructor, CallArguments arguments) {
24
+		super(position, BasicTypeID.VOID, binaryThrow(position, constructor.getHeader().thrownType, multiThrow(position, arguments.arguments)));
25 25
 		
26 26
 		this.objectType = type;
27 27
 		this.constructor = constructor;

+ 5
- 5
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ConstructorThisCallExpression.java View File

@@ -9,21 +9,21 @@ import org.openzen.zencode.shared.CodePosition;
9 9
 import org.openzen.zenscript.codemodel.member.ref.FunctionalMemberRef;
10 10
 import org.openzen.zenscript.codemodel.scope.TypeScope;
11 11
 import org.openzen.zenscript.codemodel.type.BasicTypeID;
12
-import org.openzen.zenscript.codemodel.type.StoredType;
12
+import org.openzen.zenscript.codemodel.type.TypeID;
13 13
 
14 14
 /**
15 15
  *
16 16
  * @author Hoofdgebruiker
17 17
  */
18 18
 public class ConstructorThisCallExpression extends Expression {
19
-	public final StoredType objectType;
19
+	public final TypeID objectType;
20 20
 	public final FunctionalMemberRef constructor;
21 21
 	public final CallArguments arguments;
22 22
 	
23
-	public ConstructorThisCallExpression(CodePosition position, StoredType type, FunctionalMemberRef constructor, CallArguments arguments) {
24
-		super(position, BasicTypeID.VOID.stored, binaryThrow(position, constructor.getHeader().thrownType, multiThrow(position, arguments.arguments)));
23
+	public ConstructorThisCallExpression(CodePosition position, TypeID type, FunctionalMemberRef constructor, CallArguments arguments) {
24
+		super(position, BasicTypeID.VOID, binaryThrow(position, constructor.getHeader().thrownType, multiThrow(position, arguments.arguments)));
25 25
 		
26
-		if (type.type instanceof BasicTypeID)
26
+		if (type instanceof BasicTypeID)
27 27
 			throw new IllegalArgumentException("Type cannot be basic type");
28 28
 		
29 29
 		this.objectType = type;

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/DummyExpression.java View File

@@ -7,14 +7,14 @@ package org.openzen.zenscript.codemodel.expression;
7 7
 
8 8
 import org.openzen.zencode.shared.CodePosition;
9 9
 import org.openzen.zenscript.codemodel.scope.TypeScope;
10
-import org.openzen.zenscript.codemodel.type.StoredType;
10
+import org.openzen.zenscript.codemodel.type.TypeID;
11 11
 
12 12
 /**
13 13
  *
14 14
  * @author Hoofdgebruiker
15 15
  */
16 16
 public class DummyExpression extends Expression {
17
-	public DummyExpression(StoredType type) {
17
+	public DummyExpression(TypeID type) {
18 18
 		super(CodePosition.BUILTIN, type, null);
19 19
 	}
20 20
 

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/EnumConstantExpression.java View File

@@ -20,13 +20,13 @@ public class EnumConstantExpression extends Expression {
20 20
 	public final EnumConstantMember value;
21 21
 	
22 22
 	public EnumConstantExpression(CodePosition position, TypeID type, EnumConstantMember value) {
23
-		super(position, type.stored(), null);
23
+		super(position, type, null);
24 24
 		
25 25
 		this.value = value;
26 26
 	}
27 27
 	
28 28
 	public EnumConstantExpression(CodePosition position, GlobalTypeRegistry registry, EnumDefinition type, EnumConstantMember value) {
29
-		super(position, registry.getForDefinition(type).stored(), null);
29
+		super(position, registry.getForDefinition(type), null);
30 30
 		
31 31
 		this.value = value;
32 32
 	}

+ 17
- 19
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/Expression.java View File

@@ -7,7 +7,6 @@ package org.openzen.zenscript.codemodel.expression;
7 7
 
8 8
 import java.util.Collections;
9 9
 import java.util.List;
10
-import java.util.Objects;
11 10
 import java.util.function.Consumer;
12 11
 import java.util.stream.Collectors;
13 12
 import org.openzen.zencode.shared.CodePosition;
@@ -18,14 +17,13 @@ import org.openzen.zenscript.codemodel.OperatorType;
18 17
 import org.openzen.zenscript.codemodel.member.EnumConstantMember;
19 18
 import org.openzen.zenscript.codemodel.partial.IPartialExpression;
20 19
 import org.openzen.zenscript.codemodel.GenericName;
20
+import org.openzen.zenscript.codemodel.type.TypeID;
21 21
 import org.openzen.zenscript.codemodel.type.member.TypeMemberGroup;
22 22
 import org.openzen.zenscript.codemodel.type.member.TypeMembers;
23 23
 import org.openzen.zenscript.codemodel.scope.TypeScope;
24 24
 import org.openzen.zenscript.codemodel.statement.Statement;
25 25
 import org.openzen.zenscript.codemodel.statement.StatementTransformer;
26 26
 import org.openzen.zenscript.codemodel.type.InvalidTypeID;
27
-import org.openzen.zenscript.codemodel.type.StoredType;
28
-import org.openzen.zenscript.codemodel.type.storage.UniqueStorageTag;
29 27
 
30 28
 /**
31 29
  *
@@ -35,10 +33,10 @@ public abstract class Expression implements IPartialExpression {
35 33
 	public static final Expression[] NONE = new Expression[0];
36 34
 	
37 35
 	public final CodePosition position;
38
-	public final StoredType type;
39
-	public final StoredType thrownType;
36
+	public final TypeID type;
37
+	public final TypeID thrownType;
40 38
 	
41
-	public Expression(CodePosition position, StoredType type, StoredType thrownType) {
39
+	public Expression(CodePosition position, TypeID type, TypeID thrownType) {
42 40
 		if (type == null)
43 41
 			throw new NullPointerException();
44 42
 		//if (type.type == BasicTypeID.UNDETERMINED)
@@ -73,7 +71,7 @@ public abstract class Expression implements IPartialExpression {
73 71
 	public abstract Expression normalize(TypeScope scope);
74 72
 	
75 73
 	@Override
76
-	public List<StoredType> getAssignHints() {
74
+	public List<TypeID> getAssignHints() {
77 75
 		return Collections.singletonList(type);
78 76
 	}
79 77
 	
@@ -82,11 +80,11 @@ public abstract class Expression implements IPartialExpression {
82 80
 		return this;
83 81
 	}
84 82
 	
85
-	public Expression castExplicit(CodePosition position, TypeScope scope, StoredType asType, boolean optional) {
83
+	public Expression castExplicit(CodePosition position, TypeScope scope, TypeID asType, boolean optional) {
86 84
 		return scope.getTypeMembers(type).castExplicit(position, this, asType, optional);
87 85
 	}
88 86
 	
89
-	public Expression castImplicit(CodePosition position, TypeScope scope, StoredType asType) {
87
+	public Expression castImplicit(CodePosition position, TypeScope scope, TypeID asType) {
90 88
 		return scope.getTypeMembers(type).castImplicit(position, this, asType, true);
91 89
 	}
92 90
 	
@@ -101,13 +99,13 @@ public abstract class Expression implements IPartialExpression {
101 99
 	}
102 100
 	
103 101
 	@Override
104
-	public List<StoredType>[] predictCallTypes(CodePosition position, TypeScope scope, List<StoredType> hints, int arguments) {
102
+	public List<TypeID>[] predictCallTypes(CodePosition position, TypeScope scope, List<TypeID> hints, int arguments) {
105 103
 		TypeMemberGroup group = scope.getTypeMembers(type).getGroup(OperatorType.CALL);
106 104
 		return group.predictCallTypes(position, scope, hints, arguments);
107 105
 	}
108 106
 	
109 107
 	@Override
110
-	public List<FunctionHeader> getPossibleFunctionHeaders(TypeScope scope, List<StoredType> hints, int arguments) {
108
+	public List<FunctionHeader> getPossibleFunctionHeaders(TypeScope scope, List<TypeID> hints, int arguments) {
111 109
 		TypeMemberGroup group = scope.getTypeMembers(type).getGroup(OperatorType.CALL);
112 110
 		return group.getMethodMembers().stream()
113 111
 				.filter(method -> method.member.getHeader().accepts(arguments) && !method.member.isStatic())
@@ -116,13 +114,13 @@ public abstract class Expression implements IPartialExpression {
116 114
 	}
117 115
 	
118 116
 	@Override
119
-	public Expression call(CodePosition position, TypeScope scope, List<StoredType> hints, CallArguments arguments) throws CompileException {
117
+	public Expression call(CodePosition position, TypeScope scope, List<TypeID> hints, CallArguments arguments) throws CompileException {
120 118
 		TypeMemberGroup group = scope.getTypeMembers(type).getGroup(OperatorType.CALL);
121 119
 		return group.call(position, scope, this, arguments, false);
122 120
 	}
123 121
 	
124 122
 	@Override
125
-	public IPartialExpression getMember(CodePosition position, TypeScope scope, List<StoredType> hints, GenericName name) throws CompileException {
123
+	public IPartialExpression getMember(CodePosition position, TypeScope scope, List<TypeID> hints, GenericName name) throws CompileException {
126 124
 		TypeMembers members = scope.getTypeMembers(type);
127 125
 		IPartialExpression result = members.getMemberExpression(position, scope, this, name, false);
128 126
 		if (result == null)
@@ -131,7 +129,7 @@ public abstract class Expression implements IPartialExpression {
131 129
 	}
132 130
 	
133 131
 	@Override
134
-	public StoredType[] getTypeArguments() {
132
+	public TypeID[] getTypeArguments() {
135 133
 		return null;
136 134
 	}
137 135
 	
@@ -147,19 +145,19 @@ public abstract class Expression implements IPartialExpression {
147 145
 		throw new UnsupportedOperationException("Cannot evaluate this value to an enum constant!");
148 146
 	}
149 147
 	
150
-	public static StoredType binaryThrow(CodePosition position, StoredType left, StoredType right) {
151
-		if (Objects.equals(left, right))
148
+	public static TypeID binaryThrow(CodePosition position, TypeID left, TypeID right) {
149
+		if (left == right)
152 150
 			return left;
153 151
 		else if (left == null)
154 152
 			return right;
155 153
 		else if (right == null)
156 154
 			return left;
157 155
 		else
158
-			return new InvalidTypeID(position, CompileExceptionCode.DIFFERENT_EXCEPTIONS, "two different exceptions in same operation: " + left.toString() + " and " + right.toString()).stored(UniqueStorageTag.INSTANCE);
156
+			return new InvalidTypeID(position, CompileExceptionCode.DIFFERENT_EXCEPTIONS, "two different exceptions in same operation: " + left.toString() + " and " + right.toString());
159 157
 	}
160 158
 	
161
-	public static StoredType multiThrow(CodePosition position, Expression[] expressions) {
162
-		StoredType result = null;
159
+	public static TypeID multiThrow(CodePosition position, Expression[] expressions) {
160
+		TypeID result = null;
163 161
 		for (Expression expression : expressions)
164 162
 			result = binaryThrow(position, result, expression.thrownType);
165 163
 		return result;

+ 2
- 3
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ExpressionSymbol.java View File

@@ -11,7 +11,6 @@ import org.openzen.zenscript.codemodel.context.TypeResolutionContext;
11 11
 import org.openzen.zenscript.codemodel.partial.IPartialExpression;
12 12
 import org.openzen.zenscript.codemodel.scope.BaseScope;
13 13
 import org.openzen.zenscript.codemodel.type.ISymbol;
14
-import org.openzen.zenscript.codemodel.type.StoredType;
15 14
 import org.openzen.zenscript.codemodel.type.TypeID;
16 15
 
17 16
 /**
@@ -26,12 +25,12 @@ public class ExpressionSymbol implements ISymbol {
26 25
 	}
27 26
 
28 27
 	@Override
29
-	public IPartialExpression getExpression(CodePosition position, BaseScope scope, StoredType[] typeArguments) {
28
+	public IPartialExpression getExpression(CodePosition position, BaseScope scope, TypeID[] typeArguments) {
30 29
 		return function.apply(position, scope);
31 30
 	}
32 31
 
33 32
 	@Override
34
-	public TypeID getType(CodePosition position, TypeResolutionContext context, StoredType[] typeArguments) {
33
+	public TypeID getType(CodePosition position, TypeResolutionContext context, TypeID[] typeArguments) {
35 34
 		return null;
36 35
 	}
37 36
 }

+ 4
- 4
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ExpressionVisitor.java View File

@@ -117,7 +117,9 @@ public interface ExpressionVisitor<T> {
117 117
 	T visitOrOr(OrOrExpression expression);
118 118
 	
119 119
 	T visitPanic(PanicExpression expression);
120
-	
120
+
121
+	T visitPlatformSpecific(Expression expression);
122
+
121 123
 	T visitPostCall(PostCallExpression expression);
122 124
 	
123 125
 	T visitRange(RangeExpression expression);
@@ -137,9 +139,7 @@ public interface ExpressionVisitor<T> {
137 139
 	T visitStaticGetter(StaticGetterExpression expression);
138 140
 	
139 141
 	T visitStaticSetter(StaticSetterExpression expression);
140
-	
141
-	T visitStorageCast(StorageCastExpression expression);
142
-	
142
+
143 143
 	T visitSupertypeCast(SupertypeCastExpression expression);
144 144
 	
145 145
 	T visitThis(ThisExpression expression);

+ 4
- 4
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ExpressionVisitorWithContext.java View File

@@ -113,7 +113,9 @@ public interface ExpressionVisitorWithContext<C, R> {
113 113
 	R visitOrOr(C context, OrOrExpression expression);
114 114
 	
115 115
 	R visitPanic(C context, PanicExpression expression);
116
-	
116
+
117
+	R visitPlatformSpecific(C context, Expression expression);
118
+
117 119
 	R visitPostCall(C context, PostCallExpression expression);
118 120
 	
119 121
 	R visitRange(C context, RangeExpression expression);
@@ -133,9 +135,7 @@ public interface ExpressionVisitorWithContext<C, R> {
133 135
 	R visitStaticGetter(C context, StaticGetterExpression expression);
134 136
 	
135 137
 	R visitStaticSetter(C context, StaticSetterExpression expression);
136
-	
137
-	R visitStorageCast(C context, StorageCastExpression expression);
138
-	
138
+
139 139
 	R visitSupertypeCast(C context, SupertypeCastExpression expression);
140 140
 	
141 141
 	R visitThis(C context, ThisExpression expression);

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/FunctionExpression.java View File

@@ -17,7 +17,7 @@ import org.openzen.zenscript.codemodel.statement.ExpressionStatement;
17 17
 import org.openzen.zenscript.codemodel.statement.LoopStatement;
18 18
 import org.openzen.zenscript.codemodel.statement.ReturnStatement;
19 19
 import org.openzen.zenscript.codemodel.statement.Statement;
20
-import org.openzen.zenscript.codemodel.type.StoredType;
20
+import org.openzen.zenscript.codemodel.type.TypeID;
21 21
 
22 22
 /**
23 23
  *
@@ -30,7 +30,7 @@ public class FunctionExpression extends Expression {
30 30
 	
31 31
 	public FunctionExpression(
32 32
 			CodePosition position,
33
-			StoredType type,
33
+			TypeID type,
34 34
 			LambdaClosure closure,
35 35
 			FunctionHeader header,
36 36
 			Statement body) {

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/GetFieldExpression.java View File

@@ -11,7 +11,7 @@ import org.openzen.zencode.shared.CodePosition;
11 11
 import org.openzen.zenscript.codemodel.member.IDefinitionMember;
12 12
 import org.openzen.zenscript.codemodel.member.ref.FieldMemberRef;
13 13
 import org.openzen.zenscript.codemodel.scope.TypeScope;
14
-import org.openzen.zenscript.codemodel.type.StoredType;
14
+import org.openzen.zenscript.codemodel.type.TypeID;
15 15
 
16 16
 /**
17 17
  *
@@ -29,7 +29,7 @@ public class GetFieldExpression extends Expression {
29 29
 	}
30 30
 	
31 31
 	@Override
32
-	public List<StoredType> getAssignHints() {
32
+	public List<TypeID> getAssignHints() {
33 33
 		return Collections.singletonList(type);
34 34
 	}
35 35
 	

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/GetStaticFieldExpression.java View File

@@ -11,7 +11,7 @@ import org.openzen.zencode.shared.CodePosition;
11 11
 import org.openzen.zenscript.codemodel.member.IDefinitionMember;
12 12
 import org.openzen.zenscript.codemodel.member.ref.FieldMemberRef;
13 13
 import org.openzen.zenscript.codemodel.scope.TypeScope;
14
-import org.openzen.zenscript.codemodel.type.StoredType;
14
+import org.openzen.zenscript.codemodel.type.TypeID;
15 15
 
16 16
 /**
17 17
  *
@@ -27,7 +27,7 @@ public class GetStaticFieldExpression extends Expression {
27 27
 	}
28 28
 	
29 29
 	@Override
30
-	public List<StoredType> getAssignHints() {
30
+	public List<TypeID> getAssignHints() {
31 31
 		return Collections.singletonList(field.getType());
32 32
 	}
33 33
 	

+ 3
- 4
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/InvalidExpression.java View File

@@ -5,12 +5,11 @@
5 5
  */
6 6
 package org.openzen.zenscript.codemodel.expression;
7 7
 
8
-import jdk.nashorn.internal.ir.Assignment;
9 8
 import org.openzen.zencode.shared.CodePosition;
10 9
 import org.openzen.zencode.shared.CompileException;
11 10
 import org.openzen.zencode.shared.CompileExceptionCode;
12 11
 import org.openzen.zenscript.codemodel.scope.TypeScope;
13
-import org.openzen.zenscript.codemodel.type.StoredType;
12
+import org.openzen.zenscript.codemodel.type.TypeID;
14 13
 
15 14
 /**
16 15
  *
@@ -20,14 +19,14 @@ public class InvalidExpression extends Expression {
20 19
 	public final CompileExceptionCode code;
21 20
 	public final String message;
22 21
 	
23
-	public InvalidExpression(CodePosition position, StoredType type, CompileExceptionCode code, String message) {
22
+	public InvalidExpression(CodePosition position, TypeID type, CompileExceptionCode code, String message) {
24 23
 		super(position, type, null);
25 24
 		
26 25
 		this.code = code;
27 26
 		this.message = message;
28 27
 	}
29 28
 	
30
-	public InvalidExpression(StoredType type, CompileException cause) {
29
+	public InvalidExpression(TypeID type, CompileException cause) {
31 30
 		this(cause.position, type, cause.code, cause.message);
32 31
 	}
33 32
 	

+ 1
- 1
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/IsExpression.java View File

@@ -19,7 +19,7 @@ public class IsExpression extends Expression {
19 19
 	public final TypeID isType;
20 20
 	
21 21
 	public IsExpression(CodePosition position, Expression value, TypeID type) {
22
-		super(position, BasicTypeID.BOOL.stored, value.thrownType);
22
+		super(position, BasicTypeID.BOOL, value.thrownType);
23 23
 		
24 24
 		this.value = value;
25 25
 		this.isType = type;

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/MakeConstExpression.java View File

@@ -7,7 +7,7 @@ package org.openzen.zenscript.codemodel.expression;
7 7
 
8 8
 import org.openzen.zencode.shared.CodePosition;
9 9
 import org.openzen.zenscript.codemodel.scope.TypeScope;
10
-import org.openzen.zenscript.codemodel.type.StoredType;
10
+import org.openzen.zenscript.codemodel.type.TypeID;
11 11
 
12 12
 /**
13 13
  *
@@ -16,7 +16,7 @@ import org.openzen.zenscript.codemodel.type.StoredType;
16 16
 public class MakeConstExpression extends Expression {
17 17
 	public final Expression value;
18 18
 	
19
-	public MakeConstExpression(CodePosition position, Expression value, StoredType constType) {
19
+	public MakeConstExpression(CodePosition position, Expression value, TypeID constType) {
20 20
 		super(position, constType, value.thrownType);
21 21
 		
22 22
 		this.value = value;

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/MapExpression.java View File

@@ -7,7 +7,7 @@ package org.openzen.zenscript.codemodel.expression;
7 7
 
8 8
 import org.openzen.zencode.shared.CodePosition;
9 9
 import org.openzen.zenscript.codemodel.scope.TypeScope;
10
-import org.openzen.zenscript.codemodel.type.StoredType;
10
+import org.openzen.zenscript.codemodel.type.TypeID;
11 11
 
12 12
 /**
13 13
  *
@@ -21,7 +21,7 @@ public class MapExpression extends Expression {
21 21
 			CodePosition position,
22 22
 			Expression[] keys,
23 23
 			Expression[] values,
24
-			StoredType type) {
24
+			TypeID type) {
25 25
 		super(position, type, binaryThrow(position, multiThrow(position, keys), multiThrow(position, values)));
26 26
 		
27 27
 		this.keys = keys;

+ 6
- 6
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/MatchExpression.java View File

@@ -18,7 +18,7 @@ import org.openzen.zenscript.codemodel.statement.SwitchStatement;
18 18
 import org.openzen.zenscript.codemodel.statement.VarStatement;
19 19
 import org.openzen.zenscript.codemodel.statement.VariableID;
20 20
 import org.openzen.zenscript.codemodel.type.BasicTypeID;
21
-import org.openzen.zenscript.codemodel.type.StoredType;
21
+import org.openzen.zenscript.codemodel.type.TypeID;
22 22
 
23 23
 /**
24 24
  *
@@ -28,7 +28,7 @@ public class MatchExpression extends Expression {
28 28
 	public final Expression value;
29 29
 	public final Case[] cases;
30 30
 	
31
-	public MatchExpression(CodePosition position, Expression value, StoredType type, Case[] cases) {
31
+	public MatchExpression(CodePosition position, Expression value, TypeID type, Case[] cases) {
32 32
 		super(position, type, binaryThrow(position, value.thrownType, getThrownType(position, cases)));
33 33
 		
34 34
 		this.value = value;
@@ -89,7 +89,7 @@ public class MatchExpression extends Expression {
89 89
 				hasDefault = true;
90 90
 		}
91 91
 		if (!hasDefault) {
92
-			Statement defaultCase = new ExpressionStatement(position, new PanicExpression(position, BasicTypeID.VOID.stored, new ConstantStringExpression(position, "Missing case")));
92
+			Statement defaultCase = new ExpressionStatement(position, new PanicExpression(position, BasicTypeID.VOID, new ConstantStringExpression(position, "Missing case")));
93 93
 			switchStatement.cases.add(new SwitchCase(null, new Statement[] { defaultCase }));
94 94
 		}
95 95
 		return new SwitchedMatch(result, switchStatement);
@@ -124,11 +124,11 @@ public class MatchExpression extends Expression {
124 124
 		}
125 125
 	}
126 126
 	
127
-	private static StoredType getThrownType(CodePosition position, Case[] cases) {
127
+	private static TypeID getThrownType(CodePosition position, Case[] cases) {
128 128
 		if (cases.length == 0)
129 129
 			return null;
130
-		
131
-		StoredType result = cases[0].value.thrownType;
130
+
131
+		TypeID result = cases[0].value.thrownType;
132 132
 		for (int i = 1; i < cases.length; i++)
133 133
 			result = binaryThrow(position, result, cases[i].value.thrownType);
134 134
 		

+ 3
- 3
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/NewExpression.java View File

@@ -9,7 +9,7 @@ import org.openzen.zencode.shared.CodePosition;
9 9
 import org.openzen.zenscript.codemodel.FunctionHeader;
10 10
 import org.openzen.zenscript.codemodel.member.ref.FunctionalMemberRef;
11 11
 import org.openzen.zenscript.codemodel.scope.TypeScope;
12
-import org.openzen.zenscript.codemodel.type.StoredType;
12
+import org.openzen.zenscript.codemodel.type.TypeID;
13 13
 
14 14
 /**
15 15
  *
@@ -22,7 +22,7 @@ public class NewExpression extends Expression {
22 22
 	
23 23
 	public NewExpression(
24 24
 			CodePosition position,
25
-			StoredType type,
25
+			TypeID type,
26 26
 			FunctionalMemberRef constructor,
27 27
 			CallArguments arguments)
28 28
 	{
@@ -31,7 +31,7 @@ public class NewExpression extends Expression {
31 31
 	
32 32
 	public NewExpression(
33 33
 			CodePosition position,
34
-			StoredType type,
34
+			TypeID type,
35 35
 			FunctionalMemberRef constructor,
36 36
 			CallArguments arguments,
37 37
 			FunctionHeader instancedHeader)

+ 3
- 3
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/NullExpression.java View File

@@ -8,7 +8,7 @@ package org.openzen.zenscript.codemodel.expression;
8 8
 import org.openzen.zencode.shared.CodePosition;
9 9
 import org.openzen.zenscript.codemodel.scope.TypeScope;
10 10
 import org.openzen.zenscript.codemodel.type.BasicTypeID;
11
-import org.openzen.zenscript.codemodel.type.StoredType;
11
+import org.openzen.zenscript.codemodel.type.TypeID;
12 12
 
13 13
 /**
14 14
  *
@@ -16,10 +16,10 @@ import org.openzen.zenscript.codemodel.type.StoredType;
16 16
  */
17 17
 public class NullExpression extends Expression {
18 18
 	public NullExpression(CodePosition position) {
19
-		super(position, BasicTypeID.NULL.stored, null);
19
+		super(position, BasicTypeID.NULL, null);
20 20
 	}
21 21
 	
22
-	public NullExpression(CodePosition position, StoredType optionalType) {
22
+	public NullExpression(CodePosition position, TypeID optionalType) {
23 23
 		super(position, optionalType, null);
24 24
 	}
25 25
 

+ 1
- 1
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/OrOrExpression.java View File

@@ -18,7 +18,7 @@ public class OrOrExpression extends Expression {
18 18
 	public final Expression right;
19 19
 	
20 20
 	public OrOrExpression(CodePosition position, Expression left, Expression right) {
21
-		super(position, BasicTypeID.BOOL.stored, binaryThrow(position, left.thrownType, right.thrownType));
21
+		super(position, BasicTypeID.BOOL, binaryThrow(position, left.thrownType, right.thrownType));
22 22
 		
23 23
 		this.left = left;
24 24
 		this.right = right;

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/PanicExpression.java View File

@@ -7,7 +7,7 @@ package org.openzen.zenscript.codemodel.expression;
7 7
 
8 8
 import org.openzen.zencode.shared.CodePosition;
9 9
 import org.openzen.zenscript.codemodel.scope.TypeScope;
10
-import org.openzen.zenscript.codemodel.type.StoredType;
10
+import org.openzen.zenscript.codemodel.type.TypeID;
11 11
 
12 12
 /**
13 13
  *
@@ -16,7 +16,7 @@ import org.openzen.zenscript.codemodel.type.StoredType;
16 16
 public class PanicExpression extends Expression {
17 17
 	public final Expression value;
18 18
 	
19
-	public PanicExpression(CodePosition position, StoredType type, Expression value) {
19
+	public PanicExpression(CodePosition position, TypeID type, Expression value) {
20 20
 		super(position, type, null);
21 21
 		
22 22
 		this.value = value;

+ 4
- 4
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/RangeExpression.java View File

@@ -8,7 +8,7 @@ package org.openzen.zenscript.codemodel.expression;
8 8
 import org.openzen.zencode.shared.CodePosition;
9 9
 import org.openzen.zenscript.codemodel.scope.TypeScope;
10 10
 import org.openzen.zenscript.codemodel.type.RangeTypeID;
11
-import org.openzen.zenscript.codemodel.type.StoredType;
11
+import org.openzen.zenscript.codemodel.type.TypeID;
12 12
 
13 13
 /**
14 14
  *
@@ -18,14 +18,14 @@ public class RangeExpression extends Expression {
18 18
 	public final Expression from;
19 19
 	public final Expression to;
20 20
 	
21
-	public RangeExpression(CodePosition position, StoredType type, Expression from, Expression to) {
21
+	public RangeExpression(CodePosition position, TypeID type, Expression from, Expression to) {
22 22
 		super(position, type, binaryThrow(position, from.thrownType, to.thrownType));
23 23
 	
24 24
 		this.from = from;
25 25
 		this.to = to;
26 26
 	}
27 27
 	
28
-	private RangeExpression(CodePosition position, StoredType type, Expression from, Expression to, StoredType thrownType) {
28
+	private RangeExpression(CodePosition position, TypeID type, Expression from, Expression to, TypeID thrownType) {
29 29
 		super(position, type, thrownType);
30 30
 		
31 31
 		this.from = from;
@@ -51,7 +51,7 @@ public class RangeExpression extends Expression {
51 51
 
52 52
 	@Override
53 53
 	public Expression normalize(TypeScope scope) {
54
-		StoredType baseType = ((RangeTypeID)type.type).baseType;
54
+		TypeID baseType = ((RangeTypeID)type).baseType;
55 55
 		return new RangeExpression(
56 56
 				position,
57 57
 				type.getNormalized(),

+ 1
- 1
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/SameObjectExpression.java View File

@@ -19,7 +19,7 @@ public class SameObjectExpression extends Expression {
19 19
 	public final boolean inverted;
20 20
 	
21 21
 	public SameObjectExpression(CodePosition position, Expression left, Expression right, boolean inverted) {
22
-		super(position, BasicTypeID.BOOL.stored, binaryThrow(position, left.thrownType, right.thrownType));
22
+		super(position, BasicTypeID.BOOL, binaryThrow(position, left.thrownType, right.thrownType));
23 23
 		
24 24
 		this.left = left;
25 25
 		this.right = right;

+ 0
- 46
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/StorageCastExpression.java View File

@@ -1,46 +0,0 @@
1
-/*
2
- * To change this license header, choose License Headers in Project Properties.
3
- * To change this template file, choose Tools | Templates
4
- * and open the template in the editor.
5
- */
6
-package org.openzen.zenscript.codemodel.expression;
7
-
8
-import org.openzen.zencode.shared.CodePosition;
9
-import org.openzen.zenscript.codemodel.scope.TypeScope;
10
-import org.openzen.zenscript.codemodel.type.StoredType;
11
-
12
-/**
13
- *
14
- * @author Hoofdgebruiker
15
- */
16
-public class StorageCastExpression extends Expression {
17
-	public final Expression value;
18
-	
19
-	public StorageCastExpression(CodePosition position, Expression value, StoredType toType) {
20
-		super(position, toType, value.thrownType);
21
-		
22
-		this.value = value;
23
-	}
24
-
25
-	@Override
26
-	public <T> T accept(ExpressionVisitor<T> visitor) {
27
-		return visitor.visitStorageCast(this);
28
-	}
29
-
30
-	@Override
31
-	public <C, R> R accept(C context, ExpressionVisitorWithContext<C, R> visitor) {
32
-		return visitor.visitStorageCast(context, this);
33
-	}
34
-
35
-	@Override
36
-	public Expression transform(ExpressionTransformer transformer) {
37
-		Expression transformed = transformer.transform(value);
38
-		return transformed == this ? this : new StorageCastExpression(position, transformed, type);
39
-	}
40
-
41
-	@Override
42
-	public Expression normalize(TypeScope scope) {
43
-		Expression normalized = value.normalize(scope);
44
-		return normalized == value ? this : new StorageCastExpression(position, normalized, type);
45
-	}
46
-}

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/SupertypeCastExpression.java View File

@@ -7,7 +7,7 @@ package org.openzen.zenscript.codemodel.expression;
7 7
 
8 8
 import org.openzen.zencode.shared.CodePosition;
9 9
 import org.openzen.zenscript.codemodel.scope.TypeScope;
10
-import org.openzen.zenscript.codemodel.type.StoredType;
10
+import org.openzen.zenscript.codemodel.type.TypeID;
11 11
 
12 12
 /**
13 13
  * Using to cast a class type to a base type.
@@ -17,7 +17,7 @@ import org.openzen.zenscript.codemodel.type.StoredType;
17 17
 public class SupertypeCastExpression extends Expression {
18 18
 	public final Expression value;
19 19
 	
20
-	public SupertypeCastExpression(CodePosition position, Expression value, StoredType type) {
20
+	public SupertypeCastExpression(CodePosition position, Expression value, TypeID type) {
21 21
 		super(position, type, value.thrownType);
22 22
 		
23 23
 		this.value = value;

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ThisExpression.java View File

@@ -8,14 +8,14 @@ package org.openzen.zenscript.codemodel.expression;
8 8
 import org.openzen.zencode.shared.CodePosition;
9 9
 import org.openzen.zenscript.codemodel.partial.IPartialExpression;
10 10
 import org.openzen.zenscript.codemodel.scope.TypeScope;
11
-import org.openzen.zenscript.codemodel.type.StoredType;
11
+import org.openzen.zenscript.codemodel.type.TypeID;
12 12
 
13 13
 /**
14 14
  *
15 15
  * @author Hoofdgebruiker
16 16
  */
17 17
 public class ThisExpression extends Expression {
18
-	public ThisExpression(CodePosition position, StoredType type) {
18
+	public ThisExpression(CodePosition position, TypeID type) {
19 19
 		super(position, type, null);
20 20
 	}
21 21
 	

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/ThrowExpression.java View File

@@ -7,7 +7,7 @@ package org.openzen.zenscript.codemodel.expression;
7 7
 
8 8
 import org.openzen.zencode.shared.CodePosition;
9 9
 import org.openzen.zenscript.codemodel.scope.TypeScope;
10
-import org.openzen.zenscript.codemodel.type.StoredType;
10
+import org.openzen.zenscript.codemodel.type.TypeID;
11 11
 
12 12
 /**
13 13
  *
@@ -16,7 +16,7 @@ import org.openzen.zenscript.codemodel.type.StoredType;
16 16
 public class ThrowExpression extends Expression {
17 17
 	public final Expression value;
18 18
 	
19
-	public ThrowExpression(CodePosition position, StoredType type, Expression value) {
19
+	public ThrowExpression(CodePosition position, TypeID type, Expression value) {
20 20
 		super(position, type, value.type);
21 21
 		
22 22
 		this.value = value;

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/TryConvertExpression.java View File

@@ -7,7 +7,7 @@ package org.openzen.zenscript.codemodel.expression;
7 7
 
8 8
 import org.openzen.zencode.shared.CodePosition;
9 9
 import org.openzen.zenscript.codemodel.scope.TypeScope;
10
-import org.openzen.zenscript.codemodel.type.StoredType;
10
+import org.openzen.zenscript.codemodel.type.TypeID;
11 11
 
12 12
 /**
13 13
  *
@@ -16,7 +16,7 @@ import org.openzen.zenscript.codemodel.type.StoredType;
16 16
 public class TryConvertExpression extends Expression {
17 17
 	public final Expression value;
18 18
 	
19
-	public TryConvertExpression(CodePosition position, StoredType type, Expression value) {
19
+	public TryConvertExpression(CodePosition position, TypeID type, Expression value) {
20 20
 		super(position, type, null);
21 21
 		
22 22
 		this.value = value;

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/TryRethrowAsExceptionExpression.java View File

@@ -7,7 +7,7 @@ package org.openzen.zenscript.codemodel.expression;
7 7
 
8 8
 import org.openzen.zencode.shared.CodePosition;
9 9
 import org.openzen.zenscript.codemodel.scope.TypeScope;
10
-import org.openzen.zenscript.codemodel.type.StoredType;
10
+import org.openzen.zenscript.codemodel.type.TypeID;
11 11
 
12 12
 /**
13 13
  *
@@ -16,7 +16,7 @@ import org.openzen.zenscript.codemodel.type.StoredType;
16 16
 public class TryRethrowAsExceptionExpression extends Expression {
17 17
 	public final Expression value;
18 18
 	
19
-	public TryRethrowAsExceptionExpression(CodePosition position, StoredType type, Expression value, StoredType thrownType) {
19
+	public TryRethrowAsExceptionExpression(CodePosition position, TypeID type, Expression value, TypeID thrownType) {
20 20
 		super(position, type, thrownType);
21 21
 		
22 22
 		this.value = value;

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/TryRethrowAsResultExpression.java View File

@@ -7,7 +7,7 @@ package org.openzen.zenscript.codemodel.expression;
7 7
 
8 8
 import org.openzen.zencode.shared.CodePosition;
9 9
 import org.openzen.zenscript.codemodel.scope.TypeScope;
10
-import org.openzen.zenscript.codemodel.type.StoredType;
10
+import org.openzen.zenscript.codemodel.type.TypeID;
11 11
 
12 12
 /**
13 13
  *
@@ -16,7 +16,7 @@ import org.openzen.zenscript.codemodel.type.StoredType;
16 16
 public class TryRethrowAsResultExpression extends Expression {
17 17
 	public final Expression value;
18 18
 	
19
-	public TryRethrowAsResultExpression(CodePosition position, StoredType type, Expression value) {
19
+	public TryRethrowAsResultExpression(CodePosition position, TypeID type, Expression value) {
20 20
 		super(position, type, null);
21 21
 		
22 22
 		this.value = value;

+ 4
- 4
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/VariantValueExpression.java View File

@@ -10,7 +10,7 @@ import org.openzen.zencode.shared.CodePosition;
10 10
 import org.openzen.zencode.shared.CompileException;
11 11
 import org.openzen.zenscript.codemodel.member.ref.VariantOptionRef;
12 12
 import org.openzen.zenscript.codemodel.scope.TypeScope;
13
-import org.openzen.zenscript.codemodel.type.StoredType;
13
+import org.openzen.zenscript.codemodel.type.TypeID;
14 14
 
15 15
 /**
16 16
  *
@@ -20,11 +20,11 @@ public class VariantValueExpression extends Expression {
20 20
 	public final VariantOptionRef option;
21 21
 	public final Expression[] arguments;
22 22
 	
23
-	public VariantValueExpression(CodePosition position, StoredType variantType, VariantOptionRef option) {
23
+	public VariantValueExpression(CodePosition position, TypeID variantType, VariantOptionRef option) {
24 24
 		this(position, variantType, option, Expression.NONE);
25 25
 	}
26 26
 	
27
-	public VariantValueExpression(CodePosition position, StoredType variantType, VariantOptionRef option, Expression[] arguments) {
27
+	public VariantValueExpression(CodePosition position, TypeID variantType, VariantOptionRef option, Expression[] arguments) {
28 28
 		super(position, variantType, multiThrow(position, arguments));
29 29
 		
30 30
 		this.option = option;
@@ -36,7 +36,7 @@ public class VariantValueExpression extends Expression {
36 36
 	}
37 37
 	
38 38
 	@Override
39
-	public Expression call(CodePosition position, TypeScope scope, List<StoredType> hints, CallArguments arguments) throws CompileException {
39
+	public Expression call(CodePosition position, TypeScope scope, List<TypeID> hints, CallArguments arguments) throws CompileException {
40 40
 		if (arguments != null)
41 41
 			return super.call(position, scope, hints, arguments);
42 42
 		

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/expression/WrapOptionalExpression.java View File

@@ -7,7 +7,7 @@ package org.openzen.zenscript.codemodel.expression;
7 7
 
8 8
 import org.openzen.zencode.shared.CodePosition;
9 9
 import org.openzen.zenscript.codemodel.scope.TypeScope;
10
-import org.openzen.zenscript.codemodel.type.StoredType;
10
+import org.openzen.zenscript.codemodel.type.TypeID;
11 11
 
12 12
 /**
13 13
  *
@@ -16,7 +16,7 @@ import org.openzen.zenscript.codemodel.type.StoredType;
16 16
 public class WrapOptionalExpression extends Expression {
17 17
 	public final Expression value;
18 18
 	
19
-	public WrapOptionalExpression(CodePosition position, Expression value, StoredType optionalType) {
19
+	public WrapOptionalExpression(CodePosition position, Expression value, TypeID optionalType) {
20 20
 		super(position, optionalType, value.thrownType);
21 21
 		
22 22
 		if (value.type.isOptional())

+ 2
- 3
CodeModel/src/main/java/org/openzen/zenscript/codemodel/generic/ParameterSuperBound.java View File

@@ -9,7 +9,6 @@ import org.openzen.zenscript.codemodel.GenericMapper;
9 9
 import org.openzen.zenscript.codemodel.type.member.TypeMembers;
10 10
 import org.openzen.zenscript.codemodel.type.member.LocalMemberCache;
11 11
 import org.openzen.zenscript.codemodel.type.TypeID;
12
-import org.openzen.zenscript.codemodel.type.storage.BorrowStorageTag;
13 12
 
14 13
 /**
15 14
  *
@@ -34,12 +33,12 @@ public final class ParameterSuperBound implements TypeParameterBound {
34 33
 
35 34
 	@Override
36 35
 	public boolean matches(LocalMemberCache cache, TypeID type) {
37
-		return cache.get(this.type.stored(BorrowStorageTag.THIS)).extendsOrImplements(type);
36
+		return cache.get(this.type).extendsOrImplements(type);
38 37
 	}
39 38
 
40 39
 	@Override
41 40
 	public TypeParameterBound instance(GenericMapper mapper) {
42
-		TypeID translated = type.instance(mapper, null).type;
41
+		TypeID translated = type.instance(mapper);
43 42
 		if (translated == type)
44 43
 			return this;
45 44
 		

+ 3
- 6
CodeModel/src/main/java/org/openzen/zenscript/codemodel/generic/ParameterTypeBound.java View File

@@ -11,7 +11,6 @@ import org.openzen.zenscript.codemodel.type.member.TypeMembers;
11 11
 import org.openzen.zenscript.codemodel.type.member.LocalMemberCache;
12 12
 import org.openzen.zenscript.codemodel.type.member.TypeMemberPriority;
13 13
 import org.openzen.zenscript.codemodel.type.TypeID;
14
-import org.openzen.zenscript.codemodel.type.storage.BorrowStorageTag;
15 14
 
16 15
 /**
17 16
  *
@@ -33,19 +32,17 @@ public final class ParameterTypeBound implements TypeParameterBound {
33 32
 
34 33
 	@Override
35 34
 	public void registerMembers(LocalMemberCache cache, TypeMembers members) {
36
-		cache.get(type.stored(members.type.getSpecifiedStorage()))
37
-				.copyMembersTo(members, TypeMemberPriority.FROM_TYPE_BOUNDS);
35
+		cache.get(type).copyMembersTo(members, TypeMemberPriority.FROM_TYPE_BOUNDS);
38 36
 	}
39 37
 
40 38
 	@Override
41 39
 	public boolean matches(LocalMemberCache cache, TypeID type) {
42
-		return cache.get(type.stored(BorrowStorageTag.THIS))
43
-				.extendsOrImplements(this.type);
40
+		return cache.get(type).extendsOrImplements(this.type);
44 41
 	}
45 42
 
46 43
 	@Override
47 44
 	public TypeParameterBound instance(GenericMapper mapper) {
48
-		return new ParameterTypeBound(position, type.instance(mapper, null).type);
45
+		return new ParameterTypeBound(position, type.instance(mapper));
49 46
 	}
50 47
 
51 48
 	@Override

+ 0
- 5
CodeModel/src/main/java/org/openzen/zenscript/codemodel/generic/TypeParameter.java View File

@@ -11,7 +11,6 @@ import org.openzen.zencode.shared.CodePosition;
11 11
 import org.openzen.zencode.shared.Taggable;
12 12
 import org.openzen.zenscript.codemodel.type.TypeID;
13 13
 import org.openzen.zenscript.codemodel.type.member.LocalMemberCache;
14
-import org.openzen.zenscript.codemodel.type.storage.StorageTag;
15 14
 
16 15
 /**
17 16
  *
@@ -22,7 +21,6 @@ public class TypeParameter extends Taggable {
22 21
 	
23 22
 	public final CodePosition position;
24 23
 	public final String name;
25
-	public StorageTag storage = null;
26 24
 	public final List<TypeParameterBound> bounds = new ArrayList<>();
27 25
 	
28 26
 	public TypeParameter(CodePosition position, String name) {
@@ -72,15 +70,12 @@ public class TypeParameter extends Taggable {
72 70
         
73 71
         if(!name.equals(that.name))
74 72
             return false;
75
-        if(!Objects.equals(storage, that.storage))
76
-            return false;
77 73
         return bounds.equals(that.bounds);
78 74
     }
79 75
     
80 76
     @Override
81 77
     public int hashCode() {
82 78
         int result = name.hashCode();
83
-        result = 31 * result + (storage != null ? storage.hashCode() : 0);
84 79
         result = 31 * result + bounds.hashCode();
85 80
         return result;
86 81
     }

+ 4
- 4
CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/CasterMember.java View File

@@ -13,8 +13,8 @@ import org.openzen.zenscript.codemodel.Modifiers;
13 13
 import org.openzen.zenscript.codemodel.member.ref.CasterMemberRef;
14 14
 import org.openzen.zenscript.codemodel.scope.TypeScope;
15 15
 import org.openzen.zenscript.codemodel.type.GlobalTypeRegistry;
16
+import org.openzen.zenscript.codemodel.type.TypeID;
16 17
 import org.openzen.zenscript.codemodel.type.member.TypeMembers;
17
-import org.openzen.zenscript.codemodel.type.StoredType;
18 18
 import org.openzen.zenscript.codemodel.type.member.BuiltinID;
19 19
 import org.openzen.zenscript.codemodel.type.member.TypeMemberPriority;
20 20
 
@@ -23,14 +23,14 @@ import org.openzen.zenscript.codemodel.type.member.TypeMemberPriority;
23 23
  * @author Hoofdgebruiker
24 24
  */
25 25
 public class CasterMember extends FunctionalMember {
26
-	public StoredType toType;
26
+	public TypeID toType;
27 27
 	public CasterMemberRef overrides;
28 28
 	
29 29
 	public CasterMember(
30 30
 			CodePosition position,
31 31
 			HighLevelDefinition definition,
32 32
 			int modifiers,
33
-			StoredType toType,
33
+			TypeID toType,
34 34
 			BuiltinID builtin)
35 35
 	{
36 36
 		super(position, definition, modifiers, new FunctionHeader(toType), builtin);
@@ -58,7 +58,7 @@ public class CasterMember extends FunctionalMember {
58 58
 		return "caster to " + toType.toString();
59 59
 	}
60 60
 	
61
-	public StoredType getTargetType() {
61
+	public TypeID getTargetType() {
62 62
 		return toType;
63 63
 	}
64 64
 	

+ 3
- 3
CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/ConstMember.java View File

@@ -14,7 +14,7 @@ import org.openzen.zenscript.codemodel.expression.Expression;
14 14
 import org.openzen.zenscript.codemodel.member.ref.ConstMemberRef;
15 15
 import org.openzen.zenscript.codemodel.member.ref.DefinitionMemberRef;
16 16
 import org.openzen.zenscript.codemodel.scope.TypeScope;
17
-import org.openzen.zenscript.codemodel.type.StoredType;
17
+import org.openzen.zenscript.codemodel.type.TypeID;
18 18
 import org.openzen.zenscript.codemodel.type.member.BuiltinID;
19 19
 import org.openzen.zenscript.codemodel.type.member.TypeMemberPriority;
20 20
 import org.openzen.zenscript.codemodel.type.member.TypeMembers;
@@ -27,7 +27,7 @@ public class ConstMember extends PropertyMember {
27 27
 	public final String name;
28 28
 	public Expression value;
29 29
 	
30
-	public ConstMember(CodePosition position, HighLevelDefinition definition, int modifiers, String name, StoredType type, BuiltinID builtin) {
30
+	public ConstMember(CodePosition position, HighLevelDefinition definition, int modifiers, String name, TypeID type, BuiltinID builtin) {
31 31
 		super(position, definition, modifiers, type, builtin);
32 32
 		
33 33
 		this.name = name;
@@ -81,7 +81,7 @@ public class ConstMember extends PropertyMember {
81 81
 	}
82 82
 
83 83
 	@Override
84
-	public DefinitionMemberRef ref(StoredType type, GenericMapper mapper) {
84
+	public DefinitionMemberRef ref(TypeID type, GenericMapper mapper) {
85 85
 		return new ConstMemberRef(type, this, mapper);
86 86
 	}
87 87
 	

+ 1
- 1
CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/ConstructorMember.java View File

@@ -37,7 +37,7 @@ public class ConstructorMember extends FunctionalMember {
37 37
 				position,
38 38
 				definition,
39 39
 				modifiers,
40
-				new FunctionHeader(header.typeParameters, BasicTypeID.VOID.stored, header.thrownType, header.storage, header.parameters),
40
+				new FunctionHeader(header.typeParameters, BasicTypeID.VOID, header.thrownType, header.parameters),
41 41
 				builtin);
42 42
 	}
43 43
 	

+ 4
- 5
CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/FieldMember.java View File

@@ -22,7 +22,6 @@ import org.openzen.zenscript.codemodel.statement.ExpressionStatement;
22 22
 import org.openzen.zenscript.codemodel.statement.ReturnStatement;
23 23
 import org.openzen.zenscript.codemodel.type.GlobalTypeRegistry;
24 24
 import org.openzen.zenscript.codemodel.type.member.TypeMembers;
25
-import org.openzen.zenscript.codemodel.type.StoredType;
26 25
 import org.openzen.zenscript.codemodel.type.TypeID;
27 26
 import org.openzen.zenscript.codemodel.type.member.BuiltinID;
28 27
 import org.openzen.zenscript.codemodel.type.member.TypeMemberPriority;
@@ -45,8 +44,8 @@ public class FieldMember extends PropertyMember {
45 44
 			HighLevelDefinition definition,
46 45
 			int modifiers,
47 46
 			String name,
48
-			StoredType thisType,
49
-			StoredType type,
47
+			TypeID thisType,
48
+			TypeID type,
50 49
 			GlobalTypeRegistry registry,
51 50
 			int autoGetterAccess,
52 51
 			int autoSetterAccess,
@@ -92,7 +91,7 @@ public class FieldMember extends PropertyMember {
92 91
 			HighLevelDefinition definition,
93 92
 			int modifiers,
94 93
 			String name,
95
-			StoredType type,
94
+			TypeID type,
96 95
 			int autoGetterAccess,
97 96
 			int autoSetterAccess,
98 97
 			GetterMember autoGetter,
@@ -173,7 +172,7 @@ public class FieldMember extends PropertyMember {
173 172
 	}
174 173
 
175 174
 	@Override
176
-	public DefinitionMemberRef ref(StoredType type, GenericMapper mapper) {
175
+	public DefinitionMemberRef ref(TypeID type, GenericMapper mapper) {
177 176
 		return new FieldMemberRef(type, this, mapper);
178 177
 	}
179 178
 	

+ 3
- 3
CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/FunctionalMember.java View File

@@ -15,7 +15,7 @@ import org.openzen.zenscript.codemodel.member.ref.FunctionalMemberRef;
15 15
 import org.openzen.zenscript.codemodel.scope.TypeScope;
16 16
 import org.openzen.zenscript.codemodel.statement.LoopStatement;
17 17
 import org.openzen.zenscript.codemodel.statement.Statement;
18
-import org.openzen.zenscript.codemodel.type.StoredType;
18
+import org.openzen.zenscript.codemodel.type.TypeID;
19 19
 import org.openzen.zenscript.codemodel.type.member.BuiltinID;
20 20
 
21 21
 /**
@@ -47,12 +47,12 @@ public abstract class FunctionalMember extends DefinitionMember {
47 47
 	
48 48
 	public abstract FunctionalKind getKind();
49 49
 	
50
-	public FunctionalMemberRef ref(StoredType type) {
50
+	public FunctionalMemberRef ref(TypeID type) {
51 51
 		return new FunctionalMemberRef(this, type, null);
52 52
 	}
53 53
 	
54 54
 	@Override
55
-	public FunctionalMemberRef ref(StoredType type, GenericMapper mapper) {
55
+	public FunctionalMemberRef ref(TypeID type, GenericMapper mapper) {
56 56
 		return new FunctionalMemberRef(this, type, mapper);
57 57
 	}
58 58
 	

+ 6
- 6
CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/GetterMember.java View File

@@ -16,8 +16,8 @@ import org.openzen.zenscript.codemodel.scope.TypeScope;
16 16
 import org.openzen.zenscript.codemodel.statement.LoopStatement;
17 17
 import org.openzen.zenscript.codemodel.statement.Statement;
18 18
 import org.openzen.zenscript.codemodel.type.BasicTypeID;
19
+import org.openzen.zenscript.codemodel.type.TypeID;
19 20
 import org.openzen.zenscript.codemodel.type.member.TypeMembers;
20
-import org.openzen.zenscript.codemodel.type.StoredType;
21 21
 import org.openzen.zenscript.codemodel.type.member.BuiltinID;
22 22
 import org.openzen.zenscript.codemodel.type.member.TypeMemberPriority;
23 23
 
@@ -35,7 +35,7 @@ public class GetterMember extends PropertyMember {
35 35
 			HighLevelDefinition definition,
36 36
 			int modifiers,
37 37
 			String name,
38
-			StoredType type,
38
+			TypeID type,
39 39
 			BuiltinID builtin) {
40 40
 		super(position, definition, modifiers, type, builtin);
41 41
 		
@@ -45,8 +45,8 @@ public class GetterMember extends PropertyMember {
45 45
 	public void setBody(Statement body) {
46 46
 		this.body = body;
47 47
 		
48
-		if (getType().type == BasicTypeID.UNDETERMINED) {
49
-			StoredType returnType = body.getReturnType();
48
+		if (getType() == BasicTypeID.UNDETERMINED) {
49
+			TypeID returnType = body.getReturnType();
50 50
 			if (returnType != null)
51 51
 				setType(returnType);
52 52
 		}
@@ -102,12 +102,12 @@ public class GetterMember extends PropertyMember {
102 102
 	public void setOverrides(GetterMemberRef override) {
103 103
 		this.overrides = override;
104 104
 		
105
-		if (getType().type == BasicTypeID.UNDETERMINED)
105
+		if (getType() == BasicTypeID.UNDETERMINED)
106 106
 			setType(override.getType());
107 107
 	}
108 108
 
109 109
 	@Override
110
-	public GetterMemberRef ref(StoredType type, GenericMapper mapper) {
110
+	public GetterMemberRef ref(TypeID type, GenericMapper mapper) {
111 111
 		return new GetterMemberRef(type, this, mapper);
112 112
 	}
113 113
 	

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/IDefinitionMember.java View File

@@ -14,7 +14,7 @@ import org.openzen.zenscript.codemodel.HighLevelDefinition;
14 14
 import org.openzen.zenscript.codemodel.annotations.MemberAnnotation;
15 15
 import org.openzen.zenscript.codemodel.member.ref.DefinitionMemberRef;
16 16
 import org.openzen.zenscript.codemodel.scope.TypeScope;
17
-import org.openzen.zenscript.codemodel.type.StoredType;
17
+import org.openzen.zenscript.codemodel.type.TypeID;
18 18
 import org.openzen.zenscript.codemodel.type.member.BuiltinID;
19 19
 import org.openzen.zenscript.codemodel.type.member.TypeMemberPriority;
20 20
 import org.openzen.zenscript.codemodel.type.member.TypeMembers;
@@ -56,7 +56,7 @@ public interface IDefinitionMember {
56 56
 	
57 57
 	boolean isAbstract();
58 58
 	
59
-	DefinitionMemberRef ref(StoredType type, GenericMapper mapper);
59
+	DefinitionMemberRef ref(TypeID type, GenericMapper mapper);
60 60
 	
61 61
 	FunctionHeader getHeader();
62 62
 	

+ 6
- 7
CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/ImplementationMember.java View File

@@ -20,7 +20,6 @@ import org.openzen.zenscript.codemodel.member.ref.DefinitionMemberRef;
20 20
 import org.openzen.zenscript.codemodel.member.ref.ImplementationMemberRef;
21 21
 import org.openzen.zenscript.codemodel.scope.TypeScope;
22 22
 import org.openzen.zenscript.codemodel.type.member.TypeMembers;
23
-import org.openzen.zenscript.codemodel.type.StoredType;
24 23
 import org.openzen.zenscript.codemodel.type.member.BuiltinID;
25 24
 import org.openzen.zenscript.codemodel.type.member.TypeMemberPriority;
26 25
 import org.openzen.zenscript.codemodel.type.TypeID;
@@ -46,10 +45,10 @@ public class ImplementationMember extends DefinitionMember {
46 45
 
47 46
 	@Override
48 47
 	public void registerTo(TypeMembers members, TypeMemberPriority priority, GenericMapper mapper) {
49
-		TypeID instancedType = mapper == null ? type : mapper.map(type.stored()).type;
50
-		members.addImplementation(new ImplementationMemberRef(this, members.type, instancedType.stored(members.type.getSpecifiedStorage())), priority);
48
+		TypeID instancedType = mapper == null ? type : mapper.map(type);
49
+		members.addImplementation(new ImplementationMemberRef(this, members.type, instancedType), priority);
51 50
 		
52
-		TypeMembers interfaceTypeMembers = members.getMemberCache().get(instancedType.stored(members.type.getActualStorage()));
51
+		TypeMembers interfaceTypeMembers = members.getMemberCache().get(instancedType);
53 52
 		interfaceTypeMembers.copyMembersTo(members, TypeMemberPriority.INTERFACE);
54 53
 	}
55 54
 
@@ -98,8 +97,8 @@ public class ImplementationMember extends DefinitionMember {
98 97
 				implemented.add(member.getOverrides().getTarget());
99 98
 		}
100 99
 		
101
-		TypeMembers interfaceMembers = scope.getTypeMembers(type.stored());
102
-		TypeMembers definitionMembers = scope.getTypeMembers(scope.getTypeRegistry().getForMyDefinition(definition).stored());
100
+		TypeMembers interfaceMembers = scope.getTypeMembers(type);
101
+		TypeMembers definitionMembers = scope.getTypeMembers(scope.getTypeRegistry().getForMyDefinition(definition));
103 102
 		
104 103
 		definitionBorrowedMembers.clear();
105 104
 		definitionBorrowedMembers.putAll(interfaceMembers.borrowInterfaceMembersFromDefinition(implemented, definitionMembers));
@@ -111,7 +110,7 @@ public class ImplementationMember extends DefinitionMember {
111 110
 	}
112 111
 
113 112
 	@Override
114
-	public DefinitionMemberRef ref(StoredType type, GenericMapper mapper) {
113
+	public DefinitionMemberRef ref(TypeID type, GenericMapper mapper) {
115 114
 		throw new UnsupportedOperationException("Cannot create an implementation reference");
116 115
 	}
117 116
 

+ 4
- 4
CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/InnerDefinition.java View File

@@ -11,7 +11,7 @@ import org.openzen.zenscript.codemodel.HighLevelDefinition;
11 11
 import org.openzen.zenscript.codemodel.generic.TypeParameter;
12 12
 import org.openzen.zenscript.codemodel.type.DefinitionTypeID;
13 13
 import org.openzen.zenscript.codemodel.type.GlobalTypeRegistry;
14
-import org.openzen.zenscript.codemodel.type.StoredType;
14
+import org.openzen.zenscript.codemodel.type.TypeID;
15 15
 
16 16
 /**
17 17
  *
@@ -19,19 +19,19 @@ import org.openzen.zenscript.codemodel.type.StoredType;
19 19
  */
20 20
 public class InnerDefinition {
21 21
 	public final HighLevelDefinition definition;
22
-	public final Map<TypeParameter, StoredType> outerTypeArguments;
22
+	public final Map<TypeParameter, TypeID> outerTypeArguments;
23 23
 	
24 24
 	public InnerDefinition(HighLevelDefinition definition) {
25 25
 		this.definition = definition;
26 26
 		this.outerTypeArguments = Collections.emptyMap();
27 27
 	}
28 28
 	
29
-	public InnerDefinition(HighLevelDefinition definition, Map<TypeParameter, StoredType> outerTypeArguments) {
29
+	public InnerDefinition(HighLevelDefinition definition, Map<TypeParameter, TypeID> outerTypeArguments) {
30 30
 		this.definition = definition;
31 31
 		this.outerTypeArguments = outerTypeArguments;
32 32
 	}
33 33
 	
34
-	public DefinitionTypeID instance(GlobalTypeRegistry registry, StoredType[] typeArguments, DefinitionTypeID outer) {
34
+	public DefinitionTypeID instance(GlobalTypeRegistry registry, TypeID[] typeArguments, DefinitionTypeID outer) {
35 35
 		return registry.getForDefinition(definition, typeArguments, outer);
36 36
 	}
37 37
 }

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/InnerDefinitionMember.java View File

@@ -13,7 +13,7 @@ import org.openzen.zenscript.codemodel.Modifiers;
13 13
 import org.openzen.zenscript.codemodel.definition.InterfaceDefinition;
14 14
 import org.openzen.zenscript.codemodel.member.ref.DefinitionMemberRef;
15 15
 import org.openzen.zenscript.codemodel.scope.TypeScope;
16
-import org.openzen.zenscript.codemodel.type.StoredType;
16
+import org.openzen.zenscript.codemodel.type.TypeID;
17 17
 import org.openzen.zenscript.codemodel.type.member.BuiltinID;
18 18
 import org.openzen.zenscript.codemodel.type.member.TypeMemberPriority;
19 19
 import org.openzen.zenscript.codemodel.type.member.TypeMembers;
@@ -87,7 +87,7 @@ public class InnerDefinitionMember extends DefinitionMember {
87 87
 	}
88 88
 
89 89
 	@Override
90
-	public DefinitionMemberRef ref(StoredType type, GenericMapper mapper) {
90
+	public DefinitionMemberRef ref(TypeID type, GenericMapper mapper) {
91 91
 		throw new UnsupportedOperationException("Cannot create an inner definition reference");
92 92
 	}
93 93
 	

+ 6
- 7
CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/IteratorMember.java View File

@@ -13,22 +13,21 @@ import org.openzen.zenscript.codemodel.member.ref.DefinitionMemberRef;
13 13
 import org.openzen.zenscript.codemodel.member.ref.IteratorMemberRef;
14 14
 import org.openzen.zenscript.codemodel.statement.Statement;
15 15
 import org.openzen.zenscript.codemodel.type.GlobalTypeRegistry;
16
-import org.openzen.zenscript.codemodel.type.StoredType;
16
+import org.openzen.zenscript.codemodel.type.TypeID;
17 17
 import org.openzen.zenscript.codemodel.type.member.BuiltinID;
18 18
 import org.openzen.zenscript.codemodel.type.member.TypeMemberPriority;
19 19
 import org.openzen.zenscript.codemodel.type.member.TypeMembers;
20
-import org.openzen.zenscript.codemodel.type.storage.UniqueStorageTag;
21 20
 
22 21
 /**
23 22
  *
24 23
  * @author Hoofdgebruiker
25 24
  */
26 25
 public class IteratorMember extends FunctionalMember {
27
-	private final StoredType[] iteratorTypes;
26
+	private final TypeID[] iteratorTypes;
28 27
 	public Statement body;
29 28
 	public IteratorMemberRef overrides;
30 29
 	
31
-	public IteratorMember(CodePosition position, HighLevelDefinition definition, int modifiers, StoredType[] iteratorTypes, GlobalTypeRegistry registry, BuiltinID builtin) {
30
+	public IteratorMember(CodePosition position, HighLevelDefinition definition, int modifiers, TypeID[] iteratorTypes, GlobalTypeRegistry registry, BuiltinID builtin) {
32 31
 		super(position, definition, modifiers, createIteratorHeader(registry, iteratorTypes), builtin);
33 32
 		
34 33
 		this.iteratorTypes = iteratorTypes;
@@ -47,7 +46,7 @@ public class IteratorMember extends FunctionalMember {
47 46
 		return iteratorTypes.length;
48 47
 	}
49 48
 	
50
-	public StoredType[] getLoopVariableTypes() {
49
+	public TypeID[] getLoopVariableTypes() {
51 50
 		return iteratorTypes;
52 51
 	}
53 52
 
@@ -85,7 +84,7 @@ public class IteratorMember extends FunctionalMember {
85 84
 		return FunctionalKind.ITERATOR;
86 85
 	}
87 86
 	
88
-	private static FunctionHeader createIteratorHeader(GlobalTypeRegistry registry, StoredType[] iteratorTypes) {
89
-		return new FunctionHeader(registry.getIterator(iteratorTypes).stored(UniqueStorageTag.INSTANCE));
87
+	private static FunctionHeader createIteratorHeader(GlobalTypeRegistry registry, TypeID[] iteratorTypes) {
88
+		return new FunctionHeader(registry.getIterator(iteratorTypes));
90 89
 	}
91 90
 }

+ 5
- 5
CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/PropertyMember.java View File

@@ -7,7 +7,7 @@ package org.openzen.zenscript.codemodel.member;
7 7
 
8 8
 import org.openzen.zencode.shared.CodePosition;
9 9
 import org.openzen.zenscript.codemodel.HighLevelDefinition;
10
-import org.openzen.zenscript.codemodel.type.StoredType;
10
+import org.openzen.zenscript.codemodel.type.TypeID;
11 11
 import org.openzen.zenscript.codemodel.type.member.BuiltinID;
12 12
 
13 13
 /**
@@ -15,10 +15,10 @@ import org.openzen.zenscript.codemodel.type.member.BuiltinID;
15 15
  * @author Hoofdgebruiker
16 16
  */
17 17
 public abstract class PropertyMember extends DefinitionMember {
18
-	private StoredType type;
18
+	private TypeID type;
19 19
 	public final BuiltinID builtin;
20 20
 	
21
-	public PropertyMember(CodePosition position, HighLevelDefinition definition, int modifiers, StoredType type, BuiltinID builtin) {
21
+	public PropertyMember(CodePosition position, HighLevelDefinition definition, int modifiers, TypeID type, BuiltinID builtin) {
22 22
 		super(position, definition, modifiers);
23 23
 		
24 24
 		if (type == null)
@@ -28,11 +28,11 @@ public abstract class PropertyMember extends DefinitionMember {
28 28
 		this.builtin = builtin;
29 29
 	}
30 30
 	
31
-	public StoredType getType() {
31
+	public TypeID getType() {
32 32
 		return type;
33 33
 	}
34 34
 	
35
-	public void setType(StoredType type) {
35
+	public void setType(TypeID type) {
36 36
 		if (type == null)
37 37
 			throw new NullPointerException();
38 38
 		

+ 4
- 4
CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/SetterMember.java View File

@@ -18,7 +18,7 @@ import org.openzen.zenscript.codemodel.scope.TypeScope;
18 18
 import org.openzen.zenscript.codemodel.statement.LoopStatement;
19 19
 import org.openzen.zenscript.codemodel.statement.Statement;
20 20
 import org.openzen.zenscript.codemodel.type.BasicTypeID;
21
-import org.openzen.zenscript.codemodel.type.StoredType;
21
+import org.openzen.zenscript.codemodel.type.TypeID;
22 22
 import org.openzen.zenscript.codemodel.type.member.BuiltinID;
23 23
 import org.openzen.zenscript.codemodel.type.member.TypeMemberPriority;
24 24
 import org.openzen.zenscript.codemodel.type.member.TypeMembers;
@@ -38,7 +38,7 @@ public class SetterMember extends PropertyMember {
38 38
 			HighLevelDefinition definition,
39 39
 			int modifiers,
40 40
 			String name,
41
-			StoredType type,
41
+			TypeID type,
42 42
 			BuiltinID builtin)
43 43
 	{
44 44
 		super(position,
@@ -105,14 +105,14 @@ public class SetterMember extends PropertyMember {
105 105
 	public void setOverrides(SetterMemberRef overrides) {
106 106
 		this.overrides = overrides;
107 107
 		
108
-		if (getType().type == BasicTypeID.UNDETERMINED) {
108
+		if (getType() == BasicTypeID.UNDETERMINED) {
109 109
 			setType(overrides.getType());
110 110
 			parameter = new FunctionParameter(overrides.getType(), "value");
111 111
 		}
112 112
 	}
113 113
 
114 114
 	@Override
115
-	public DefinitionMemberRef ref(StoredType type, GenericMapper mapper) {
115
+	public DefinitionMemberRef ref(TypeID type, GenericMapper mapper) {
116 116
 		return new SetterMemberRef(type, this, mapper);
117 117
 	}
118 118
 	

+ 2
- 3
CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/StaticInitializerMember.java View File

@@ -10,13 +10,12 @@ import org.openzen.zencode.shared.ConcatMap;
10 10
 import org.openzen.zenscript.codemodel.FunctionHeader;
11 11
 import org.openzen.zenscript.codemodel.GenericMapper;
12 12
 import org.openzen.zenscript.codemodel.HighLevelDefinition;
13
-import org.openzen.zenscript.codemodel.Modifiers;
14 13
 import org.openzen.zenscript.codemodel.member.ref.DefinitionMemberRef;
15 14
 import org.openzen.zenscript.codemodel.scope.TypeScope;
16 15
 import org.openzen.zenscript.codemodel.statement.LoopStatement;
17 16
 import org.openzen.zenscript.codemodel.statement.Statement;
18 17
 import org.openzen.zenscript.codemodel.type.BasicTypeID;
19
-import org.openzen.zenscript.codemodel.type.StoredType;
18
+import org.openzen.zenscript.codemodel.type.TypeID;
20 19
 import org.openzen.zenscript.codemodel.type.member.BuiltinID;
21 20
 import org.openzen.zenscript.codemodel.type.member.TypeMemberPriority;
22 21
 import org.openzen.zenscript.codemodel.type.member.TypeMembers;
@@ -78,7 +77,7 @@ public class StaticInitializerMember extends DefinitionMember {
78 77
 	}
79 78
 
80 79
 	@Override
81
-	public DefinitionMemberRef ref(StoredType type, GenericMapper mapper) {
80
+	public DefinitionMemberRef ref(TypeID type, GenericMapper mapper) {
82 81
 		throw new UnsupportedOperationException("Cannot reference a static initializer");
83 82
 	}
84 83
 	

+ 5
- 5
CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/ref/CasterMemberRef.java View File

@@ -14,7 +14,7 @@ import org.openzen.zenscript.codemodel.expression.CastExpression;
14 14
 import org.openzen.zenscript.codemodel.expression.Expression;
15 15
 import org.openzen.zenscript.codemodel.member.CasterMember;
16 16
 import org.openzen.zenscript.codemodel.member.IDefinitionMember;
17
-import org.openzen.zenscript.codemodel.type.StoredType;
17
+import org.openzen.zenscript.codemodel.type.TypeID;
18 18
 
19 19
 /**
20 20
  *
@@ -22,10 +22,10 @@ import org.openzen.zenscript.codemodel.type.StoredType;
22 22
  */
23 23
 public class CasterMemberRef implements DefinitionMemberRef {
24 24
 	public final CasterMember member;
25
-	public final StoredType type;
26
-	public final StoredType toType;
25
+	public final TypeID type;
26
+	public final TypeID toType;
27 27
 	
28
-	public CasterMemberRef(CasterMember member, StoredType type, StoredType toType) {
28
+	public CasterMemberRef(CasterMember member, TypeID type, TypeID toType) {
29 29
 		this.member = member;
30 30
 		this.type = type;
31 31
 		this.toType = toType;
@@ -37,7 +37,7 @@ public class CasterMemberRef implements DefinitionMemberRef {
37 37
 	}
38 38
 	
39 39
 	@Override
40
-	public StoredType getOwnerType() {
40
+	public TypeID getOwnerType() {
41 41
 		return type;
42 42
 	}
43 43
 

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/ref/ConstMemberRef.java View File

@@ -7,7 +7,7 @@ package org.openzen.zenscript.codemodel.member.ref;
7 7
 
8 8
 import org.openzen.zenscript.codemodel.GenericMapper;
9 9
 import org.openzen.zenscript.codemodel.member.ConstMember;
10
-import org.openzen.zenscript.codemodel.type.StoredType;
10
+import org.openzen.zenscript.codemodel.type.TypeID;
11 11
 
12 12
 /**
13 13
  *
@@ -16,7 +16,7 @@ import org.openzen.zenscript.codemodel.type.StoredType;
16 16
 public class ConstMemberRef extends PropertyRef {
17 17
 	public final ConstMember member;
18 18
 	
19
-	public ConstMemberRef(StoredType owner, ConstMember member, GenericMapper mapper) {
19
+	public ConstMemberRef(TypeID owner, ConstMember member, GenericMapper mapper) {
20 20
 		super(owner, member, mapper);
21 21
 		this.member = member;
22 22
 	}

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/ref/DefinitionMemberRef.java View File

@@ -10,7 +10,7 @@ import org.openzen.zencode.shared.Tag;
10 10
 import org.openzen.zenscript.codemodel.FunctionHeader;
11 11
 import org.openzen.zenscript.codemodel.annotations.MemberAnnotation;
12 12
 import org.openzen.zenscript.codemodel.member.IDefinitionMember;
13
-import org.openzen.zenscript.codemodel.type.StoredType;
13
+import org.openzen.zenscript.codemodel.type.TypeID;
14 14
 
15 15
 /**
16 16
  *
@@ -29,7 +29,7 @@ public interface DefinitionMemberRef {
29 29
 		return getTarget().hasTag(type);
30 30
 	}
31 31
 	
32
-	StoredType getOwnerType();
32
+	TypeID getOwnerType();
33 33
 	
34 34
 	DefinitionMemberRef getOverrides();
35 35
 	

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/ref/FieldMemberRef.java View File

@@ -7,7 +7,7 @@ package org.openzen.zenscript.codemodel.member.ref;
7 7
 
8 8
 import org.openzen.zenscript.codemodel.GenericMapper;
9 9
 import org.openzen.zenscript.codemodel.member.FieldMember;
10
-import org.openzen.zenscript.codemodel.type.StoredType;
10
+import org.openzen.zenscript.codemodel.type.TypeID;
11 11
 
12 12
 /**
13 13
  *
@@ -16,7 +16,7 @@ import org.openzen.zenscript.codemodel.type.StoredType;
16 16
 public class FieldMemberRef extends PropertyRef {
17 17
 	public final FieldMember member;
18 18
 	
19
-	public FieldMemberRef(StoredType owner, FieldMember member, GenericMapper mapper) {
19
+	public FieldMemberRef(TypeID owner, FieldMember member, GenericMapper mapper) {
20 20
 		super(owner, member, mapper);
21 21
 		this.member = member;
22 22
 	}

+ 3
- 4
CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/ref/FunctionalMemberRef.java View File

@@ -22,7 +22,6 @@ import org.openzen.zenscript.codemodel.member.FunctionalMember;
22 22
 import org.openzen.zenscript.codemodel.member.MethodMember;
23 23
 import org.openzen.zenscript.codemodel.member.OperatorMember;
24 24
 import org.openzen.zenscript.codemodel.scope.TypeScope;
25
-import org.openzen.zenscript.codemodel.type.StoredType;
26 25
 import org.openzen.zenscript.codemodel.type.TypeID;
27 26
 import org.openzen.zenscript.codemodel.type.member.BuiltinID;
28 27
 
@@ -36,10 +35,10 @@ public class FunctionalMemberRef implements DefinitionMemberRef {
36 35
 	private final FunctionalMember target;
37 36
 	
38 37
 	private FunctionHeader header;
39
-	private final StoredType type;
38
+	private final TypeID type;
40 39
 	private GenericMapper mapper;
41 40
 	
42
-	public FunctionalMemberRef(FunctionalMember target, StoredType type, GenericMapper mapper) {
41
+	public FunctionalMemberRef(FunctionalMember target, TypeID type, GenericMapper mapper) {
43 42
 		this.target = target;
44 43
 		this.type = type;
45 44
 		
@@ -75,7 +74,7 @@ public class FunctionalMemberRef implements DefinitionMemberRef {
75 74
 	}
76 75
 	
77 76
 	@Override
78
-	public StoredType getOwnerType() {
77
+	public TypeID getOwnerType() {
79 78
 		return type;
80 79
 	}
81 80
 	

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/ref/GetterMemberRef.java View File

@@ -11,7 +11,7 @@ import org.openzen.zenscript.codemodel.expression.Expression;
11 11
 import org.openzen.zenscript.codemodel.expression.GetterExpression;
12 12
 import org.openzen.zenscript.codemodel.expression.StaticGetterExpression;
13 13
 import org.openzen.zenscript.codemodel.member.GetterMember;
14
-import org.openzen.zenscript.codemodel.type.StoredType;
14
+import org.openzen.zenscript.codemodel.type.TypeID;
15 15
 
16 16
 /**
17 17
  *
@@ -20,7 +20,7 @@ import org.openzen.zenscript.codemodel.type.StoredType;
20 20
 public class GetterMemberRef extends PropertyRef {
21 21
 	public final GetterMember member;
22 22
 	
23
-	public GetterMemberRef(StoredType owner, GetterMember member, GenericMapper mapper) {
23
+	public GetterMemberRef(TypeID owner, GetterMember member, GenericMapper mapper) {
24 24
 		super(owner, member, mapper);
25 25
 		
26 26
 		this.member = member;

+ 5
- 5
CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/ref/ImplementationMemberRef.java View File

@@ -11,7 +11,7 @@ import org.openzen.zenscript.codemodel.FunctionHeader;
11 11
 import org.openzen.zenscript.codemodel.annotations.MemberAnnotation;
12 12
 import org.openzen.zenscript.codemodel.member.IDefinitionMember;
13 13
 import org.openzen.zenscript.codemodel.member.ImplementationMember;
14
-import org.openzen.zenscript.codemodel.type.StoredType;
14
+import org.openzen.zenscript.codemodel.type.TypeID;
15 15
 
16 16
 /**
17 17
  *
@@ -19,10 +19,10 @@ import org.openzen.zenscript.codemodel.type.StoredType;
19 19
  */
20 20
 public class ImplementationMemberRef implements DefinitionMemberRef {
21 21
 	public final ImplementationMember member;
22
-	private final StoredType type;
23
-	public final StoredType implementsType;
22
+	private final TypeID type;
23
+	public final TypeID implementsType;
24 24
 	
25
-	public ImplementationMemberRef(ImplementationMember member, StoredType owner, StoredType implementsType) {
25
+	public ImplementationMemberRef(ImplementationMember member, TypeID owner, TypeID implementsType) {
26 26
 		this.member = member;
27 27
 		this.type = owner;
28 28
 		this.implementsType = implementsType;
@@ -34,7 +34,7 @@ public class ImplementationMemberRef implements DefinitionMemberRef {
34 34
 	}
35 35
 	
36 36
 	@Override
37
-	public StoredType getOwnerType() {
37
+	public TypeID getOwnerType() {
38 38
 		return type;
39 39
 	}
40 40
 

+ 0
- 0
CodeModel/src/main/java/org/openzen/zenscript/codemodel/member/ref/IteratorMemberRef.java View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save