You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Should give a compiler error message like this: Error: Cannot convert untyped value 'nil' to '[2]^int' from 'untyped nil'
Current Behavior
Compilation gives no error message and no binary is produced.
Failure Information
Checking an array to be equal to nil gives a compiler error as expected, but no error is given if the array holds pointers.
This works as expected:
a: [2]int
fmt.println(a == nil) // Error: Cannot convert untyped value 'nil' to '[2]int' from 'untyped nil'
but this silently crashes the compiler:
a: [2]^int
fmt.println(a == nil)
Steps to Reproduce
package main
import "core:fmt"
main :: proc() {
a: [2]^int
fmt.println(a == nil)
}
When running odin run . nothing gets printed.
Failure Logs
None
The text was updated successfully, but these errors were encountered:
4lbert
changed the title
Silent compiler crash is checking array of pointers to be equal to nil
Silent compiler crash when checking array of pointers to be equal to nil
Dec 26, 2024
Context
Expected Behavior
Should give a compiler error message like this:
Error: Cannot convert untyped value 'nil' to '[2]^int' from 'untyped nil'
Current Behavior
Compilation gives no error message and no binary is produced.
Failure Information
Checking an array to be equal to nil gives a compiler error as expected, but no error is given if the array holds pointers.
This works as expected:
but this silently crashes the compiler:
Steps to Reproduce
When running
odin run .
nothing gets printed.Failure Logs
None
The text was updated successfully, but these errors were encountered: