Files
c3c/test/test_suite/generic/generic_self_ref.c3
2026-01-18 00:33:43 +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();
}