Files
c3c/test/test_suite/methods/extension_method_already_exist.c3
2021-11-16 17:46:44 +01:00

30 lines
374 B
C

module foo;
fn void Bar.test(Bar *bar)
{
io::println("Inside of baz::Bar.test");
}
struct Bar
{
int x;
}
module baz;
import foo;
import std::io;
fn void foo::Bar.test(Bar *bar) // #error: This method is already defined for 'Bar'
{
io::println("Inside of baz::Bar.test");
}
module abc;
import foo;
import baz;
fn void main()
{
Bar bar;
bar.test();
}