Improved error messages for foo(void), foo(int!) declarations.

This commit is contained in:
Christoffer Lerno
2022-08-11 12:59:55 +02:00
parent 48fb342834
commit f513b6237f
14 changed files with 69 additions and 22 deletions

View File

@@ -6,7 +6,7 @@ struct St12
{
int a @align(16);
}
fn St12 f12_0(void) { while (1) {}; unreachable(); }
fn St12 f12_0() { while (1) {}; unreachable(); }
fn void f12_1(St12 a0) {}
struct St13_0 { long[3] f0; }

View File

@@ -39,7 +39,7 @@ struct St {
extern fn St func_returning_struct();
fn void loop(void) {
fn void loop() {
func_returning_struct();
}

View File

@@ -0,0 +1,3 @@
module test;
fn void test4(void!); // #error: Parameters may not be failable.

View File

@@ -0,0 +1,2 @@
fn void test(int, void) {} // #error: Parameters may not be of type 'void'.
fn void test3(void); // #error: C-style 'foo(void)' style argument declarations are not valid

View File

@@ -6,7 +6,7 @@ struct St12
{
int a @align(16);
}
fn St12 f12_0(void) { while (1) {}; unreachable(); }
fn St12 f12_0() { while (1) {}; unreachable(); }
fn void f12_1(St12 a0) {}
struct St13_0 { long[3] f0; }

View File

@@ -39,7 +39,7 @@ struct St {
extern fn St func_returning_struct();
fn void loop(void) {
fn void loop() {
func_returning_struct();
}

View File

@@ -0,0 +1,3 @@
module test;
fn void test4(void!); // #error: Parameters may not be failable.

View File

@@ -0,0 +1,2 @@
fn void test(int, void) {} // #error: Parameters may not be of type 'void'.
fn void test3(void); // #error: C-style 'foo(void)' style argument declarations are not valid