Skip to content

Commit

Permalink
Add regression tests for #209
Browse files Browse the repository at this point in the history
  • Loading branch information
LPTK committed Feb 7, 2024
1 parent a90d247 commit 6754659
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions shared/src/test/diff/nu/CycleTypeDefErrors.mls
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
:NewDefs

// * These type definitions should be checked for cyclicity, like we did in the old frontend,
// * but this is currently not implemented.


type Foo = Foo
//│ type Foo = Foo

(f: Foo) => f : Str
//│ (f: Foo) -> Str
//│ res
//│ = [Function: res]


type Foo = Foo & Int
//│ type Foo = Foo & Int

// FIXME
(f: Foo) => f : Str
//│ /!!!\ Uncaught error: java.lang.StackOverflowError


abstract class Foo: Foo
//│ abstract class Foo: Foo

// FIXME
(f: Foo) => f : Str
//│ /!!!\ Uncaught error: java.lang.StackOverflowError


abstract class Foo[T]: Foo[Int]
//│ abstract class Foo[T]: Foo[Int]

// FIXME
fun test(f: Foo['a]) = f : Str
//│ /!!!\ Uncaught error: java.lang.StackOverflowError


0 comments on commit 6754659

Please sign in to comment.