Skip to content

Commit

Permalink
Add suggested test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
chengluyu committed Jan 1, 2024
1 parent 7988884 commit 5bf69fa
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions shared/src/test/diff/codegen/NewMutualRef.mls
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,39 @@ class Bar {
//│ Int
//│ res
//│ = 1

fun foo: Int -> Int
fun foo = x => x + 1
class Bar { fun calc(x) = foo(x) }
//│ fun foo: Int -> Int
//│ class Bar {
//│ constructor()
//│ fun calc: Int -> Int
//│ }
//│ fun foo: Int -> Int

foo(0)
new Bar().calc(0)
//│ Int
//│ res
//│ = 1
//│ res
//│ = 1

class Bar { fun calc(x) = foo }
fun foo: Int
fun foo = 123
//│ class Bar {
//│ constructor()
//│ fun calc: anything -> Int
//│ }
//│ fun foo: 123
//│ fun foo: Int

foo
new Bar().calc(0)
//│ Int
//│ res
//│ = 123
//│ res
//│ = 123

0 comments on commit 5bf69fa

Please sign in to comment.