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
Console Output:
$ gprbuild -q -P main.gpr
Build completed successfully.
$ ./main
To_Int(False) = 3
To_Int(True) = 6
From_Int (3) =TRUE -- [sic!] should have been FALSE
From_Int (6) =TRUE
My knowledge of Ada is too limited to understand why this is wrong, I see nothing obvious in the code example that will explain the error.
I tried it with my own "anonymous" enum type and it is working as expected, so the problem may have something to do with the line "type My_Boolean is new Boolean"
But anyway, it is rather bad when a given example code fails to show what it is supposed to illustrate.
Cordially
The text was updated successfully, but these errors were encountered:
That is sad, indeed. I've tried the demo with GNAT GPL 2020, GNAT GPL 2021, GCC 10, GCC 12, GCC 13 and it works as expected. But with GCC 12 it fails :( I guess, this is a compiler bug.
in the page: https://learn.adacore.com/courses/whats-new-in-ada-2022/chapters/enum_val.html#before-ada-2022
build and run of the last example will give the output:
My knowledge of Ada is too limited to understand why this is wrong, I see nothing obvious in the code example that will explain the error.
I tried it with my own "anonymous" enum type and it is working as expected, so the problem may have something to do with the line "type My_Boolean is new Boolean"
But anyway, it is rather bad when a given example code fails to show what it is supposed to illustrate.
Cordially
The text was updated successfully, but these errors were encountered: