mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Scalar -> vector not implicit in call or assign.
This commit is contained in:
14
test/test_suite/vector/vector_conversion_scalar.c3
Normal file
14
test/test_suite/vector/vector_conversion_scalar.c3
Normal file
@@ -0,0 +1,14 @@
|
||||
fn void test2(int[<2>] x) {}
|
||||
fn void main()
|
||||
{
|
||||
int[<2>] y = 1;
|
||||
y[..] = 3;
|
||||
y.xy = 3; // #error: cannot use swizzling
|
||||
y *= 2;
|
||||
y = 3; // #error: explicit cast
|
||||
test2(3); // #error: explicit cast
|
||||
{|
|
||||
if (y[0] == 3) return 1; // #error: explicit cast
|
||||
return y;
|
||||
|};
|
||||
}
|
||||
Reference in New Issue
Block a user