-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework TypeAlias definition and better handled literal unions
- Loading branch information
1 parent
0e76f42
commit a73e12e
Showing
8 changed files
with
120 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export type NumberA = | ||
| 1 | ||
|
||
export type NumberB = | ||
| 2 | ||
|
||
export type NumberC = NumberA | NumberB; | ||
|
||
export type NumberD = | ||
| 3 | ||
|
||
export type NumberE = NumberC | NumberD; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module rec Glutinum | ||
|
||
(***) | ||
#r "nuget: Fable.Core" | ||
(***) | ||
|
||
open Fable.Core | ||
open System | ||
|
||
[<RequireQualifiedAccess>] | ||
type NumberA = | ||
| ``1`` = 1 | ||
|
||
[<RequireQualifiedAccess>] | ||
type NumberB = | ||
| ``2`` = 2 | ||
|
||
[<RequireQualifiedAccess>] | ||
type NumberC = | ||
| ``1`` = 1 | ||
| ``2`` = 2 | ||
|
||
[<RequireQualifiedAccess>] | ||
type NumberD = | ||
| ``3`` = 3 | ||
|
||
[<RequireQualifiedAccess>] | ||
type NumberE = | ||
| ``1`` = 1 | ||
| ``2`` = 2 | ||
| ``3`` = 3 |
3 changes: 3 additions & 0 deletions
3
tests/specs/typeAlias/unions/primitiveAndTypeReferenceToAnInterface.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface FormatObject { locale?: string, format?: string, utc?: boolean } | ||
|
||
export type OptionType = FormatObject | string | string[] |
17 changes: 17 additions & 0 deletions
17
tests/specs/typeAlias/unions/primitiveAndTypeReferenceToAnInterface.fsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module rec Glutinum | ||
|
||
(***) | ||
#r "nuget: Fable.Core" | ||
(***) | ||
|
||
open Fable.Core | ||
open System | ||
|
||
[<AllowNullLiteral>] | ||
type FormatObject = | ||
abstract member locale: string with get, set | ||
abstract member format: string with get, set | ||
abstract member utc: bool with get, set | ||
|
||
type OptionType = | ||
U3<FormatObject, string, ResizeArray<string>> |