Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect tagged type #164

Open
MangelMaxime opened this issue Nov 30, 2024 · 2 comments
Open

Detect tagged type #164

MangelMaxime opened this issue Nov 30, 2024 · 2 comments

Comments

@MangelMaxime
Copy link
Contributor

Issue created from Glutinum Tool

Glutinum version - 0.11.0

TypeScript

type Shape =
  | { kind: "circle"; radius: number }
  | { kind: "square"; x: number }
  | { kind: "triangle"; x: number; y: number };

FSharp

module rec Glutinum

open Fable.Core
open Fable.Core.JsInterop
open System

[<AllowNullLiteral>]
[<Interface>]
type Shape =
    abstract member kind: string with get, set
    abstract member radius: float with get, set
    abstract member kind: string with get, set
    abstract member x: float with get, set
    abstract member kind: string with get, set
    abstract member x: float with get, set
    abstract member y: float with get, set

Problem description

This should generate a Tagged Unions type like defined here

@joprice
Copy link

joprice commented Nov 30, 2024

I had one for this already that could be closed as a dupe #147

@MangelMaxime
Copy link
Contributor Author

Oups sorry @joprice I didn't do a search before creating mine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants