Skip to content

Erased types cannot implement abstract members #2295

Closed
@Titaye

Description

@Titaye

Description

A project referencing Fable.SignalR is not compiling with fable 3 with the error "Erased types cannot implement abstract members"

Repro code

type LogLevel = string

[<Erase>]
type NullLogger =
    interface ILogger with
        member this.log logLevel message = this.log logLevel message

    [<Emit("$0.log($1, $2)")>]
    member _.log (logLevel: LogLevel) (message: string) : unit = jsNative

Please provide the F# code to reproduce the problem or a link to the REPL.
Ideally, it should be possible to easily turn this code into a unit test.

The code could be rewritten has this in the library with Fable 3 but is it a regression or an expected behavior ?

[<Erase>]
type NullLogger =
    interface ILogger with
        [<Emit("$0.log($1, $2)")>]
        member _.log (logLevel: LogLevel) (message: string) : unit = jsNative

Expected and actual results

Code should compile

Related information

  • Fable version: Fable 3
  • Operating system : Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions