-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3bd3dbc
commit 60d42ed
Showing
3 changed files
with
57 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
// Test for https://github.com/fasterthanlime/rock/issues/903 | ||
|
||
use sam-assert | ||
|
||
describe("tuple variable decls should have precedence over members", || | ||
bar := Foo new(1337) | ||
expect(1337, bar xolophan) | ||
expect(1337, bar yardenis) | ||
) | ||
|
||
// support code | ||
|
||
Foo: class { | ||
xolophan := 1 | ||
yardenis := 2 | ||
init: func (=xolophan, =yardenis) | ||
init: func ~fromInt (input: Int) { | ||
(xolophan, yardenis) := This makeXY(input) | ||
init(xolophan, yardenis) | ||
} | ||
makeXY: static func (input: Int) -> (Int, Int) { (input, input) } | ||
} |