Problem
The following code doesn't compile:
struct Struct {}
trait Trait {}
fn main() {}
#[foo]
comptime fn foo(_: FunctionDefinition) -> Quoted {
let tr = quote { Trait }.as_trait_constraint();
let st = quote { Struct }.as_type();
quote {
impl $tr for $st {
}
}
}
It gives this error:
error: Cannot inline values of type `TraitConstraint` into this position
┌─ src/main.nr:11:5
│
11 │ ╭ quote {
12 │ │ impl $tr for $st {
13 │ │
14 │ │ }
15 │ │ }
│ ╰─────' Cannot inline value `Trait`
Happy Case
The above code should compile.
Workaround
None
Workaround Description
No response
Additional Context
No response
Project Impact
None
Blocker Context
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
Problem
The following code doesn't compile:
It gives this error:
Happy Case
The above code should compile.
Workaround
None
Workaround Description
No response
Additional Context
No response
Project Impact
None
Blocker Context
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response