mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
- Comparing a flexible array member to another type would hit an assert. #2830
- Underlying slice type not checked correctly in $defined #2829 - Checking for exhaustive cases is done even in if-chain switch if all is enum #2828
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
fn void test1()
|
||||
{
|
||||
bool a = $defined(void[]); // #error: You cannot form a slice with elements of type
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
|
||||
fn void test2()
|
||||
{
|
||||
bool b = $defined(void[*]); // #error: You cannot form an array with elements of type
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
fn void test1()
|
||||
{
|
||||
bool a = $defined(void[<*>]); // #error: 'void' is not of a vectorizable type
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
enum Baz
|
||||
{
|
||||
A, B, C,
|
||||
}
|
||||
fn void test_missing_all_cases(Baz x)
|
||||
{
|
||||
switch (x)
|
||||
{
|
||||
case x:
|
||||
}
|
||||
}
|
||||
fn int main() => 0;
|
||||
10
test/test_suite/struct/flex_array_max_type.c3
Normal file
10
test/test_suite/struct/flex_array_max_type.c3
Normal file
@@ -0,0 +1,10 @@
|
||||
struct Abc
|
||||
{
|
||||
int x;
|
||||
int[*] y;
|
||||
}
|
||||
fn void test()
|
||||
{
|
||||
Abc y;
|
||||
bool same = Abc.y == y.y; // #error: 'member_ref' and 'int[*]' are different types and cannot be compared
|
||||
}
|
||||
Reference in New Issue
Block a user