mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Updated error message #2037
This commit is contained in:
@@ -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;
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user