Fixed #1888 Casts for missing types, cast handling for script local classes

This commit is contained in:
Jindra Petřík
2022-12-02 08:56:02 +01:00
parent 913d8102be
commit 263b401efc
29 changed files with 291 additions and 139 deletions
@@ -53,29 +53,42 @@ public class TypeItem extends GraphTargetItem {
public final DottedChain fullTypeName;
public boolean printRaw = false;
public String ns;
public TypeItem(String s) {
this(s == null ? new DottedChain(new String[]{}, new String[]{""}) : DottedChain.parseWithSuffix(s));
this(s, null);
}
public TypeItem(String s, String ns) {
this(s == null ? new DottedChain(new String[]{}, new String[]{""}) : DottedChain.parseWithSuffix(s), ns);
}
public TypeItem(DottedChain fullTypeName) {
this(fullTypeName, new ArrayList<>());
}
this(fullTypeName, (String)null);
}
public TypeItem(DottedChain fullTypeName, String ns) {
this(fullTypeName, new ArrayList<>(), ns);
}
public TypeItem(DottedChain fullTypeName, List<GraphTargetItem> subtypes) {
public TypeItem(DottedChain fullTypeName, List<GraphTargetItem> subtypes, String ns) {
super(null, null, NOPRECEDENCE);
this.fullTypeName = fullTypeName;
this.ns = ns;
}
@Override
public int hashCode() {
int hash = 7;
hash = 83 * hash + Objects.hashCode(fullTypeName);
int hash = 5;
hash = 17 * hash + Objects.hashCode(this.fullTypeName);
hash = 17 * hash + Objects.hashCode(this.ns);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
@@ -83,9 +96,14 @@ public class TypeItem extends GraphTargetItem {
return false;
}
final TypeItem other = (TypeItem) obj;
return Objects.equals(fullTypeName, other.fullTypeName);
if (!Objects.equals(this.ns, other.ns)) {
return false;
}
return Objects.equals(this.fullTypeName, other.fullTypeName);
}
@Override
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
boolean as3 = localData.constantsAvm2 != null;