Skip to content

Commit

Permalink
Fixes #3541
Browse files Browse the repository at this point in the history
  • Loading branch information
ncave committed Oct 15, 2023
1 parent 597fd2c commit 816743e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Fable.Transforms/Fable2Babel.fs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ module Lib =
let tryJsConstructorFor purpose (com: IBabelCompiler) ctx (ent: Fable.Entity) =
let isErased =
match purpose with
| Annotation -> ent.IsMeasure || (FSharp2Fable.Util.isErasedOrStringEnumEntity ent && not ent.IsFSharpUnion)
| Annotation ->
ent.IsMeasure
|| (ent.IsInterface && not com.IsTypeScript)
|| (FSharp2Fable.Util.isErasedOrStringEnumEntity ent && not ent.IsFSharpUnion)
// Historically we have used interfaces to represent JS classes in bindings,
// so we allow explicit type references (e.g. for type testing) when the interface is global or imported.
// But just in case we avoid referencing interfaces for reflection (as the type may not exist in actual code)
Expand Down

0 comments on commit 816743e

Please sign in to comment.