Lyricdev
GitHub

LYR-SEM0177

'@AlwaysInline' and '@NoInline' on one function

error ยท spec 11-metaprogramming

A function carries both @AlwaysInline and @NoInline.

Explanation

The two hints say opposite things to the C compiler, which would refuse them together. A function takes one of the two.

Remove the hint you do not mean.

Wrong

@AlwaysInline
@NoInline
fn f(): int {
    return 1;
}

fn main(): void {
    let _ = f();
}
@AlwaysInline
fn f(): int {
    return 1;
}

fn main(): void {
    let _ = f();
}