@@ -1049,9 +1049,11 @@ let private transformMemberDecl (com: FableCompiler) (ctx: Context) (memb: FShar
1049
1049
let declaringEntity = FsEnt declaringEntity :> Fable.Entity
1050
1050
if isGlobalOrImportedEntity declaringEntity then ()
1051
1051
elif isErasedOrStringEnumEntity declaringEntity then
1052
- let r = makeRange memb.DeclarationLocation |> Some
1053
- " Erased types cannot implement abstract members"
1054
- |> addError com ctx.InlinePath r
1052
+ // Ignore abstract members for classes, see #2295
1053
+ if declaringEntity.IsFSharpUnion || declaringEntity.IsFSharpRecord then
1054
+ let r = makeRange memb.DeclarationLocation |> Some
1055
+ " Erased unions/records cannot implement abstract members"
1056
+ |> addError com ctx.InlinePath r
1055
1057
else
1056
1058
// Not sure when it's possible that a member implements multiple abstract signatures
1057
1059
memb.ImplementedAbstractSignatures
@@ -1096,7 +1098,8 @@ let rec private getUsedRootNames (com: Compiler) (usedNames: Set<string>) decls
1096
1098
| sub ->
1097
1099
getUsedRootNames com usedNames sub
1098
1100
| MemberOrFunctionOrValue( memb,_,_) ->
1099
- if memb.IsOverrideOrExplicitInterfaceImplementation then usedNames
1101
+ if memb.IsOverrideOrExplicitInterfaceImplementation
1102
+ || isInline memb || isEmittedOrImportedMember memb then usedNames
1100
1103
else
1101
1104
let memberName , _ = getMemberDeclarationName com memb
1102
1105
addUsedRootName com memberName usedNames
0 commit comments