Do assignment lvalue error checking in type checking
Added some tests related to this. Also improved source file position reporting in error reporting.
This commit is contained in:
8
tests_errors/lvalue-1.ispc
Normal file
8
tests_errors/lvalue-1.ispc
Normal file
@@ -0,0 +1,8 @@
|
||||
// Left hand side of assignment statement can't be assigned to
|
||||
|
||||
int foo() {return 2;}
|
||||
|
||||
int bar()
|
||||
{
|
||||
foo() = 2;
|
||||
}
|
||||
6
tests_errors/lvalue-2.ispc
Normal file
6
tests_errors/lvalue-2.ispc
Normal file
@@ -0,0 +1,6 @@
|
||||
// Can't assign to type "const uniform int32" on left-hand side
|
||||
|
||||
int bar(){
|
||||
4 = 0;
|
||||
}
|
||||
|
||||
7
tests_errors/lvalue-3.ispc
Normal file
7
tests_errors/lvalue-3.ispc
Normal file
@@ -0,0 +1,7 @@
|
||||
// Left hand side of assignment statement can't be assigned to
|
||||
|
||||
int bar(){
|
||||
int x;
|
||||
4 = x;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user