Summary
When any using directive is present, undefined types that look like sized integers (e.g., i512) produce a misleading "type mismatch" error instead of "undefined type".
Steps to Reproduce
Without using (correct behavior):
do main() {
temp x i512 = 123
}
error[E3008]: undefined type 'i512'
--> file.ez:2:10
|
2 | temp x i512 = 123
| ^ type is not defined
With any using directive (incorrect behavior):
import @std
using std
do main() {
temp x i512 = 123
}
error[E3001]: type mismatch: cannot assign int to i512
--> file.ez:5:10
|
5 | temp x i512 = 123
| ^ types do not match
Additional Testing
- Happens with
using std, using crypto, using math - any using directive
- Does NOT happen with just
import @module (no using)
- Other invalid types like
foobar, i7, i100, i1024 correctly show "undefined type" even with using
- Issue appears specific to
i512 pattern
Expected Behavior
Both cases should show error[E3008]: undefined type 'i512'.
Root Cause
The using directive appears to affect type resolution in a way that causes i512 to be treated as a valid type instead of undefined. This may be related to #909 (using directive scope issues).
Environment
- EZ version: dev (tested on main branch)
Summary
When any
usingdirective is present, undefined types that look like sized integers (e.g.,i512) produce a misleading "type mismatch" error instead of "undefined type".Steps to Reproduce
Without
using(correct behavior):With any
usingdirective (incorrect behavior):Additional Testing
using std,using crypto,using math- anyusingdirectiveimport @module(nousing)foobar,i7,i100,i1024correctly show "undefined type" even withusingi512patternExpected Behavior
Both cases should show
error[E3008]: undefined type 'i512'.Root Cause
The
usingdirective appears to affect type resolution in a way that causesi512to be treated as a valid type instead of undefined. This may be related to #909 (using directive scope issues).Environment