diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f8ad71fe..dc76cc9ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Fixed +- [#1888] AS3 - missing casts in declarations ## [18.3.2] - 2023-01-10 ### Removed diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java index 539a5afa6..a363e0abd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java @@ -135,7 +135,7 @@ public class DeclarationAVM2Item extends AVM2Item { coerType = ((ConvertAVM2Item) ssti.value).type; } //strip coerce if its declared as this type - if (coerType.equals(type) && !coerType.equals(TypeItem.UNBOUNDED)) { + if ((ssti.value instanceof CoerceAVM2Item) && coerType.equals(type) && !coerType.equals(TypeItem.UNBOUNDED)) { val = val.value; } @@ -167,7 +167,7 @@ public class DeclarationAVM2Item extends AVM2Item { coerType = ((ConvertAVM2Item) spti.value).type; } //strip coerce if its declared as this type - if (coerType.equals(type) && !coerType.equals(TypeItem.UNBOUNDED)) { + if ((spti.value instanceof CoerceAVM2Item) && coerType.equals(type) && !coerType.equals(TypeItem.UNBOUNDED)) { val = val.value; }