ImportC bad handling of enum arguments for a function.

Ali Çehreli acehreli at yahoo.com
Mon Jan 30 21:41:40 UTC 2023


On 1/30/23 12:38, Dmytro Katyukha wrote:

 > typedef enum /*enum_test_1_t*/ {
 >      E_TEST_1_ITEM_1 = 1,
 >      E_TEST_1_ITEM_2,
 > } enum_test_1_t;
 >
 > int some_func(enum_test_1_t val) {
 >      return val;
 > }

 > test.d(6): Error: function `testlib.some_func(__tag2 val)` is not
 > callable using argument types `(__anonymous)`
 > test.d(6):        cannot pass argument `E_TEST_1_ITEM_1` of type
 > `__anonymous` to parameter `__tag2 val`

Noting enum's implicit const'ness, it is probably the same issue as the 
following one which uses 'const' explicitly:

   https://issues.dlang.org/show_bug.cgi?id=23415

Ali



More information about the Digitalmars-d mailing list