-
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: Prevent infite loop when a class has a reference to a union type…
… which reference the class itself [converter]
- Loading branch information
1 parent
c86a6d6
commit 6d19aae
Showing
3 changed files
with
43 additions
and
3 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
5 changes: 5 additions & 0 deletions
5
tests/specs/references/class/classWithRecursiveUnionToItself.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,5 @@ | ||
export declare class MyClass { | ||
contains(otherBoundsOrLatLng: MyUnion | string): boolean; | ||
} | ||
|
||
export type MyUnion = MyClass | string; |
21 changes: 21 additions & 0 deletions
21
tests/specs/references/class/classWithRecursiveUnionToItself.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,21 @@ | ||
module rec Glutinum | ||
|
||
open Fable.Core | ||
open Fable.Core.JsInterop | ||
open System | ||
|
||
[<Erase>] | ||
type Exports = | ||
interface end | ||
|
||
[<AllowNullLiteral>] | ||
[<Interface>] | ||
type MyClass = | ||
abstract member contains: otherBoundsOrLatLng: U2<MyUnion, string> -> bool | ||
|
||
type MyUnion = | ||
U2<MyClass, string> | ||
|
||
(***) | ||
#r "nuget: Fable.Core" | ||
(***) |