2022-11-05 10:57:28 +01:00
|
|
|
# Tests shadowing of arguments and local variables
|
|
|
|
# across functions
|
|
|
|
import std;
|
|
|
|
|
|
|
|
|
|
|
|
fn first(x: int): int {
|
2022-11-27 14:31:53 +01:00
|
|
|
return x + 1;
|
2022-11-05 10:57:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn second(x: int): int {
|
2022-11-27 14:31:53 +01:00
|
|
|
return first(x) + 1;
|
2022-11-05 10:57:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-11-27 14:31:53 +01:00
|
|
|
print(first(0) == 1); # true
|
2022-11-23 01:02:35 +01:00
|
|
|
print(second(0) == 2); # true
|