Files
c3c/test/test_suite/generic/generic_self_ref.c3
2025-12-29 17:01:03 +01:00

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: This method is already defined for 'Widget{Label}'
{
io::printfn("Hello Label");
}
module gui::widget_types;
import gui::widget;
struct Label
{
String text;
}
fn void main()
{
Widget {int} y;
y.draw();
}