mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-25 21:00:14 +01:00
27 lines
584 B
Plaintext
27 lines
584 B
Plaintext
********** source program **********
|
|
fn add1 Int: x -> Int {
|
|
return (x + 1);
|
|
|
|
}
|
|
fn main () -> Int {
|
|
var fn Int -> Int: f = add1;
|
|
return f(0 = (- 1));
|
|
|
|
}
|
|
********** type checking **********
|
|
--- step exp Int --->
|
|
--- step exp Int --->
|
|
--- step exp Int --->
|
|
--- step exp Int --->
|
|
--- step exp Int --->
|
|
--- step exp Int --->
|
|
--- step exp fn Int -> Int --->
|
|
--- step exp Int --->
|
|
--- handle value Int with fn Int -> Int<1>(Int,) --->
|
|
--- step exp Int --->
|
|
--- handle value Int with fn Int -> Int<2>(Int,Int,) --->
|
|
11: type error in call
|
|
expected: Int
|
|
actual: Tuple(0 = Int)
|
|
EXIT CODE: 255
|