dotnet-websharper / core

WebSharper - Full-stack, functional, reactive web apps and microservices in F# and C#
https://websharper.com
Apache License 2.0
589 stars 52 forks source link

Treat interfaces as AbstractClasses when interface is marked as Stub #1396

Closed Jooseppi12 closed 3 months ago

Jooseppi12 commented 5 months ago

When there is an Import or an Inline attribute on one of the members, the interface should be treated as an AbstractClass

Jooseppi12 commented 5 months ago

They should also support Macro/Generator attributes

Also, the initial implementation, when StubInterfaces is true is causing compile time error in a scenario like this:

type MyType =
    abstract MyValue: int
    [<Inline "$0.myInline()">]
    abstract MyFunction: unit -> unit

When MyValue is used, it complains about missing members from JS translation.

Known workaround: use explicit Stub attribute