Compiler assert when using generic parameters list without any parameters. #2369

This commit is contained in:
Christoffer Lerno
2025-08-05 12:50:36 +02:00
parent 00b88a8027
commit aa910a1c44
10 changed files with 63 additions and 12 deletions

View File

@@ -0,0 +1,31 @@
module values {Type};
struct Values
{
Type[] values;
int count;
}
fn void test()
{
}
module main;
import values;
import std::collections::list;
fn void test1()
{
int x = values::test{}(); // #error: At least one generic parameter
}
fn void test2()
{
List{Values{ }} v1s; // #error: At least one generic parameter
}
fn void main()
{
List{Values{int}} v2s;
}

View File

@@ -1,10 +1,10 @@
struct Foo {
void bar; // #error: Members cannot be of
void bar; // #error: Members cannot
}
alias Void = void;
struct Foo2 {
Void bar; // #error: Members cannot be of
Void bar; // #error: Members cannot
}
typedef Void2 = void;