Resolving &X.b when X is a const incorrectly checked for runtime constness #2842

Creating a generic instance fails if it is created after interface checking #2840
This commit is contained in:
Christoffer Lerno
2026-01-25 21:24:27 +01:00
parent 3c04a326f4
commit 4899ee14e2
6 changed files with 52 additions and 15 deletions

View File

@@ -0,0 +1,8 @@
import std;
fn int foo() => 0;
alias FooFn = fn int();
enum Bar : const FooFn
{
FOO = fn () => (int)(iptr)ExclusiveRange{int}.typeid,
BAR = &foo,
}

View File

@@ -0,0 +1,4 @@
fn void unaligned_load_store(void* dst, void* src) @nostrip
{
$$unaligned_store(dst, $$unaligned_load((char*)src, 2, false), 0, false); // #error: Alignment must not be zero
}