-
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.
Fix type literal as return type for function + Add more type literal …
…tests Fix #58
- Loading branch information
1 parent
dc1b1c7
commit 1685de8
Showing
9 changed files
with
139 additions
and
4 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
3 changes: 3 additions & 0 deletions
3
tests/specs/references/typeLiteral/returnType/classMethod.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 class Test { | ||
now(): { day: number, month: number, year: number } | ||
} |
32 changes: 32 additions & 0 deletions
32
tests/specs/references/typeLiteral/returnType/classMethod.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,32 @@ | ||
module rec Glutinum | ||
|
||
open Fable.Core | ||
open System | ||
|
||
[<Erase>] | ||
type Exports = | ||
interface end | ||
|
||
[<AllowNullLiteral>] | ||
type Test = | ||
abstract member now: unit -> Test.now | ||
|
||
module Test = | ||
|
||
[<Global>] | ||
[<AllowNullLiteral>] | ||
type now | ||
[<ParamObject; Emit("$0")>] | ||
( | ||
day: float, | ||
month: float, | ||
year: float | ||
) = | ||
|
||
member val day : float = nativeOnly with get, set | ||
member val month : float = nativeOnly with get, set | ||
member val year : float = nativeOnly with get, set | ||
|
||
(***) | ||
#r "nuget: Fable.Core" | ||
(***) |
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 @@ | ||
export function Test(): { a: string, b: number } |
25 changes: 25 additions & 0 deletions
25
tests/specs/references/typeLiteral/returnType/function.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,25 @@ | ||
module rec Glutinum | ||
|
||
open Fable.Core | ||
open System | ||
|
||
[<Erase>] | ||
type Exports = | ||
[<Import("Test", "module")>] | ||
static member Test () : Test = nativeOnly | ||
|
||
[<Global>] | ||
[<AllowNullLiteral>] | ||
type Test | ||
[<ParamObject; Emit("$0")>] | ||
( | ||
a: string, | ||
b: float | ||
) = | ||
|
||
member val a : string = nativeOnly with get, set | ||
member val b : float = nativeOnly with get, set | ||
|
||
(***) | ||
#r "nuget: Fable.Core" | ||
(***) |
3 changes: 3 additions & 0 deletions
3
tests/specs/references/typeLiteral/returnType/typeAliasMethod.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 type Test = { | ||
now(): { day: number, month: number, year: number } | ||
} |
28 changes: 28 additions & 0 deletions
28
tests/specs/references/typeLiteral/returnType/typeAliasMethod.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,28 @@ | ||
module rec Glutinum | ||
|
||
open Fable.Core | ||
open System | ||
|
||
[<AllowNullLiteral>] | ||
type Test = | ||
abstract member now: unit -> Test.now | ||
|
||
module Test = | ||
|
||
[<Global>] | ||
[<AllowNullLiteral>] | ||
type now | ||
[<ParamObject; Emit("$0")>] | ||
( | ||
day: float, | ||
month: float, | ||
year: float | ||
) = | ||
|
||
member val day : float = nativeOnly with get, set | ||
member val month : float = nativeOnly with get, set | ||
member val year : float = nativeOnly with get, set | ||
|
||
(***) | ||
#r "nuget: Fable.Core" | ||
(***) |
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 class Test { | ||
date(config: { day: number, month: number, year: number }): string | ||
} |
34 changes: 34 additions & 0 deletions
34
tests/specs/references/typeLiteral/typeAlias/arguments.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,34 @@ | ||
module rec Glutinum | ||
|
||
open Fable.Core | ||
open System | ||
|
||
[<Erase>] | ||
type Exports = | ||
interface end | ||
|
||
[<AllowNullLiteral>] | ||
type Test = | ||
abstract member date: config: Test.date.config -> string | ||
|
||
module Test = | ||
|
||
module date = | ||
|
||
[<Global>] | ||
[<AllowNullLiteral>] | ||
type config | ||
[<ParamObject; Emit("$0")>] | ||
( | ||
day: float, | ||
month: float, | ||
year: float | ||
) = | ||
|
||
member val day : float = nativeOnly with get, set | ||
member val month : float = nativeOnly with get, set | ||
member val year : float = nativeOnly with get, set | ||
|
||
(***) | ||
#r "nuget: Fable.Core" | ||
(***) |