Alias and distinct types didn't check the underlying type wasn't compile time or optional.

This commit is contained in:
Christoffer Lerno
2025-09-19 18:05:29 +02:00
parent 59fd777198
commit b03ae8bb17
4 changed files with 50 additions and 4 deletions

View File

@@ -0,0 +1,13 @@
module test;
import std;
struct Foo { struct x { int a; } }
alias Floo = $typeof(Foo.x); // #error: You cannot create an alias for a member reference as it is a compile time type
alias Void = void?; // #error: You cannot create an alias for an optional type
typedef Floo2 = $typeof(Foo.x); // #error: You cannot create a distinct type for a member reference
typedef Void2 = void?; // #error: You cannot create a distinct type from
fn void main()
{
}