Skip to content

Navigation Menu

Sign in
Sign up

rock generates invalid C code when trying to access an interface's generic type #996

Open
Labels

Description

CraaazyInterface: interface <T> {
 gimme: func -> T
 doCraaazyThings: func {
 T name println()
 }
}

Generated code:

void test__CraaazyInterface_doCraaazyThings_impl(CraaazyInterface__reference this) {
 #line 5 "C:\\dev\\test.ooc"
 lang_String__String_println(this->T->name);
}
// Somewhere in a header file
struct _CraaazyInterface__reference {
 test__CraaazyInterfaceClass* impl;
 lang_types__Object* obj;
};
struct _test__CraaazyInterfaceClass {
 struct _lang_types__ClassClass __super__;
 void (*gimme)(void*, uint8_t*);
 void (*doCraaazyThings)(void*);
};

Basically, there is no way to get to T from an interface reference.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      AltStyle によって変換されたページ (->オリジナル) /