diff --git a/releasenotes.md b/releasenotes.md index 6cd37dd50..298dffd39 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -15,6 +15,7 @@ - Casting to a bitstruct would be allowed even if the type was the wrong size. - Generic modules parameterized with constants would sometimes get the wrong parameterized module name causing conversion errors #1192. - Duplicate emit of expressions on negation would incorrectly compile negated macros. +- Casting a slice address to its pointer type should not compile #1193. ### Stdlib changes - Add 'zstr' variants for `string::new_format` / `string::tformat`. diff --git a/src/compiler/enums.h b/src/compiler/enums.h index 123800569..17ff750a5 100644 --- a/src/compiler/enums.h +++ b/src/compiler/enums.h @@ -676,9 +676,9 @@ typedef enum TYPE_FAULTTYPE, TYPE_TYPEDEF, TYPE_DISTINCT, + TYPE_SUBARRAY, TYPE_ARRAY, TYPE_FIRST_ARRAYLIKE = TYPE_ARRAY, - TYPE_SUBARRAY, TYPE_FLEXIBLE_ARRAY, TYPE_INFERRED_ARRAY, TYPE_VECTOR, diff --git a/test/test_suite/cast/cast_slice_implicit.c3 b/test/test_suite/cast/cast_slice_implicit.c3 new file mode 100644 index 000000000..f07f1a10f --- /dev/null +++ b/test/test_suite/cast/cast_slice_implicit.c3 @@ -0,0 +1,7 @@ +fn void foo() +{ + int[] array; + int* ptr = array; + void* ptr2 = &array; + int* ptr3 = &array; // #error: is not permitted +} \ No newline at end of file