Misleading error message for isz -> sz
Enhancement Request
```c3
fn void skipForm(char** ptr, char form, char addressSize, ushort version)
{
switch (form)
{
case DW_FORM_ADDR:
*ptr += addressSize;
case DW_FORM_BLOCK1:
char len = **ptr;
(*ptr)++;
*ptr += len;
case DW_FORM_BLOCK2:
ushort len = read_u16_le(*ptr);
*ptr += (isz)2 + len; // error shows '2' as error, but its actually any character after ')'
case DW_FORM_BLOCK4:
uint len = read_u32_le(*ptr);
*ptr += (isz)4 + len; // no error, analysis ends after above error
```
Due to the isz -> sz change, I get the following error:
```
355: *ptr += len;
356: case DW_FORM_BLOCK2:
357: ushort len = read_u16_le(*ptr);
358: *ptr += (isz)len + 2;
^
(/home/mkp/src/osdev3/kernel/debug.c3:358:26) Error: Expected ';'
```
This is plenty misleading, as isz doesn't exist. Probably best to improve the error message with an error during semantic analysis, as isz could be technically a name now. Something like 'isz is not a recognized type cast' or something.
2 条评论