Skip to content

Commit

Permalink
Merge pull request #14 from fourst4r/patch-2
Browse files Browse the repository at this point in the history
Fix NullTypeEnforcer simplifying dynamic null comparisons
  • Loading branch information
SomeRanDev authored Feb 9, 2024
2 parents dd4c848 + 08b3d18 commit 6f0ad9f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/reflaxe/compiler/NullTypeEnforcer.hx
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ class NullTypeEnforcer {
if(e1.isNullExpr() && e2.isNullExpr()) {
expr.expr = TConst(TBool(true));
} else if(e1.isNullExpr()) {
if(!e2.t.isNull()) {
if(!e2.t.isNull() && !e2.t.isDynamic()) {
expr.expr = TConst(TBool(false));
}
} else if(e2.isNullExpr()) {
if(!e1.t.isNull()) {
if(!e1.t.isNull() && !e1.t.isDynamic()) {
expr.expr = TConst(TBool(false));
}
}
Expand All @@ -141,11 +141,11 @@ class NullTypeEnforcer {
if(e1.isNullExpr() && e2.isNullExpr()) {
expr.expr = TConst(TBool(false));
} else if(e1.isNullExpr()) {
if(!e2.t.isNull()) {
if(!e2.t.isNull() && !e2.t.isDynamic()) {
expr.expr = TConst(TBool(true));
}
} else if(e2.isNullExpr()) {
if(!e1.t.isNull()) {
if(!e1.t.isNull() && !e1.t.isDynamic()) {
expr.expr = TConst(TBool(true));
}
}
Expand Down

0 comments on commit 6f0ad9f

Please sign in to comment.