Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: X10 2.0.2
-
Fix Version/s: X10 2.2
-
Component/s: X10 Compiler: Front-end Typechecking
-
Labels:None
-
Number of attachments :
Description
If you have a switch like {{switch(n)
{ case 'a': ... }}} in which the type of "n" is Int, the compiler should complain that 'a' is not an Int, because there is no implied automatic conversion. It now ignores the problem. Downstream, when gcc attempts to compile the generated C++, what it sees is
switch(((x10_int) (n)) { case ((x10_char)'a'): ... }
gcc then complains:
error: a cast to a type other than an integral or enumeration type cannot appear in a constant-expression
Issue Links
- is depended upon by
-
XTENLANG-2584
X10 2.2 frontend issues (umbrella)
-
- is related to
-
XTENLANG-1190
Switch requires an int; cases can be byte, char, or short too.
-
- relates to
-
XTENLANG-1626
support casts from Char to integer types
-
defer all non-critical X10 issues to 2.1.0.