LYR-SEM0194
a quote in a program that does not reach std.syntax
A quote { … } stands in a program that does not import std.syntax.
Explanation
A quote builds a tree of std.syntax; without the module the program has no type for it.
Import std.syntax (and use quotes inside macros, where the trees are built).
Wrong
fn two(): int {
let _ = quote { 1 + 1 };
return 2;
}
fn main(): void {
}
Right
import std.syntax { Expr };
macro two(): Expr {
return quote { 1 + 1 };
}
fn main(): void {
}