Files
c3c/test/test_suite/generic/generic_self_ref.c3

29 lines
424 B
Plaintext

module gui::widget {Type};
import gui::widget_types;
import std::collections::list;
import std::io;
struct Widget
{
int id;
Type type;
List {any} children;
}
fn void Widget{Label}.draw(Widget* self) // #error: The same method is generated by multiple instances
{
io::printfn("Hello Label");
}
module gui::widget_types;
import gui::widget;
struct Label
{
String text;
}
fn void main()
{
Widget {int} y;
y.draw();
}