Skip to content

Commit be33e1f

Browse files
committed
Update EliminateGenerics.java
1 parent f869c76 commit be33e1f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

de.peeeq.wurstscript/src/main/java/de/peeeq/wurstscript/translation/imtranslation/EliminateGenerics.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,15 @@ private void removeGenericConstructs() {
208208
for (ImClass c : prog.getClasses()) {
209209
c.getFields().removeIf(f -> isGenericType(f.getType()));
210210
}
211+
212+
// NEW: Remove original generic global variables
213+
prog.getGlobals().removeIf(v -> {
214+
if (globalToClass.containsKey(v)) {
215+
WLogger.info("Removing generic global variable: " + v.getName() + " with type " + v.getType());
216+
return true;
217+
}
218+
return false;
219+
});
211220
}
212221

213222
private void eliminateGenericUses() {

0 commit comments

Comments
 (0)