Updated error message #2037

This commit is contained in:
Christoffer Lerno
2025-03-19 23:25:56 +01:00
parent de74e97ab1
commit 0beb30c979
5 changed files with 10 additions and 10 deletions

View File

@@ -4,7 +4,7 @@ struct Foo { int a; }
struct Bar { int b; Foo f; }
fn void main()
{
(Bar) { .f = (Foo) { foo() } }; // #error: not be discarded
(Bar) { .f = (Foo) { foo() } }; // #error: An optional value was discarded
}
fn int? foo() => 1;

View File

@@ -14,7 +14,7 @@ fn void test2()
int? x;
int y;
abc(y);
abc(x) + 4; // #error: An optional value may not be discarded
abc(x) + 4; // #error: An optional value was discarded
}
fn void test3()
@@ -30,7 +30,7 @@ fn void test4()
int? x;
int y;
def2(1);
def2(x) + 4; // #error: An optional value may not be discarded
def2(x) + 4; // #error: An optional value was discarded
}
fn void test5()
@@ -50,5 +50,5 @@ fn void test6()
fn void test7()
{
int y;
def3(y) + 4; // #error: An optional value may not be discarded
def3(y) + 4; // #error: An optional value was discarded
}

View File

@@ -14,7 +14,7 @@ fn void test2()
int? x;
int y;
abc(y);
abc(x) + 4; // #error: An optional value may not be discarded
abc(x) + 4; // #error: An optional value was discarded
}
fn void test3()
@@ -30,7 +30,7 @@ fn void test4()
int? x;
int y;
def2(1);
def2(x) + 4; // #error: An optional value may not be discarded
def2(x) + 4; // #error: An optional value was discarded
}
fn void test5()
@@ -50,5 +50,5 @@ fn void test6()
fn void test7()
{
int y;
def3(y) + 4; // #error: An optional value may not be discarded
def3(y) + 4; // #error: An optional value was discarded
}