fable-compiler/ts2fable

The get properties are not interpreted correctly

Closed this issue · 0 comments

I have a class declaration in typescript.

export declare class SKey {
    private _name;
    constructor(name: string);
    get name(): string;
    get sName(): string;
    /** Returns the name in the format, {schemaName}.{name}. */
    get fullName(): string;
    /**
     * Checks whether this SKey matches the one provided.
     * @param rhs The SKey to compare to this.
     */
    matches(rhs: SKey): boolean;
    matchesFullName(name: string): boolean;
}

The generated F# code is

type [<AllowNullLiteral>] IExports =
    abstract SKey: SKeyStatic

type [<AllowNullLiteral>] SKey =
    obj
    obj
    obj
    /// <summary>Checks whether this SKey matches the one provided.</summary>
    /// <param name="rhs">The SKey to compare to this.</param>
    abstract matches: rhs: SKey -> bool
    abstract matchesFullName: name: string -> bool

type [<AllowNullLiteral>] SKeyStatic =
    [<Emit "new $0($1...)">] abstract Create: name: string -> SKey

As one can see, the properties are not generated correctly

It should be,

abstract name: string with get

for name property.