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
This is technically two bugs, but they're very related so I'll post them both here.
The first one is that the compiler goes into an infinite loop trying to handle a bugged procedure where a polymorphic struct parameter is not correctly specialised. This only happens when you try to access and assign a field inside that function parameter.
Both should raise an error saying something along the lines of "Invalid use of a non-specialized polymorphic type 'Node' in procedure declaration", preventing the user from compiling the code.
Current Behavior
First code snippet goes into an infinite loop when compiled.
Second code snippet compiles bugged code and runs, printing into the console.
Failure Information (for bugs)
Steps to Reproduce
Copy and paste code snippets into separate odin projects
Do "odin build ."
First code snippet should hang and stay in an infinite loop
Second code snippet should compile and running it should print to the console
Failure Logs
No logs.
The text was updated successfully, but these errors were encountered:
VestaKK
changed the title
Compiler incorrectly handles bug in polymorphic struct procedure parameter
Compiler incorrectly handles bug in parametric struct procedure parameter
Apr 26, 2024
VestaKK
changed the title
Compiler incorrectly handles bug in parametric struct procedure parameter
Compiler incorrectly handles error in parametric struct procedure parameter
Apr 26, 2024
For the first snippet, bisect reveals that the infinite loop was introduced in 6d4f30d. Before, an error was reported, though the missing specialisation wouldn't be detected, as can be seen in an older issue: #2982 (see error of fn3). The second snippet here kinda matches fn2 there.
Context
This is technically two bugs, but they're very related so I'll post them both here.
The first one is that the compiler goes into an infinite loop trying to handle a bugged procedure where a polymorphic struct parameter is not correctly specialised. This only happens when you try to access and assign a field inside that function parameter.
If you don't access the struct field, the function compiles incorrectly and runs:
odin report output:
Expected Behavior
Both should raise an error saying something along the lines of "Invalid use of a non-specialized polymorphic type 'Node' in procedure declaration", preventing the user from compiling the code.
Current Behavior
First code snippet goes into an infinite loop when compiled.
Second code snippet compiles bugged code and runs, printing into the console.
Failure Information (for bugs)
Steps to Reproduce
Failure Logs
No logs.
The text was updated successfully, but these errors were encountered: