rust/src/test/compile-fail/macro-2.rs

6 lines
165 B
Rust
Raw Normal View History

//error-pattern:expanded as an identifier
fn main() {
2011-06-27 10:58:05 -07:00
#macro("mylambda", x, body, {fn f(int x) -> int {ret body}; f});
assert(#mylambda(y*1, y*2)(8) == 16);
}