Mercury Bugs - mercury
View Issue Details
0000582mercuryBugpublic2026-03-03 11:532026-03-03 11:53
Reporterwangp 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000582: generate int switches for other integer types
DescriptionThe compiler ought to be able to generate all the different switch types on all integer types, not just `int'.

We noticed this deficiency on a fact table of the form:

:- pred action_table(int16::in, int16::in, uint16::out) is semidet.
action_table(0i16, 0i16, 1661u16).
action_table(0i16, 1i16, 1661u16).
action_table(0i16, 2i16, 1661u16).
action_table(0i16, 3i16, 1661u16).
action_table(0i16, 4i16, 1661u16).
action_table(0i16, 5i16, 1661u16).
action_table(0i16, 6i16, 1661u16).
action_table(0i16, 7i16, 1661u16).
action_table(0i16, 8i16, 1661u16).
action_table(0i16, 9i16, 1661u16).
...

In the end, we replaced the input arguments with `int's (which was fine, but shouldn't be necessary).
TagsNo tags attached.
Attached Files

There are no notes attached to this issue.

Issue History
2026-03-03 11:53wangpNew Issue