Disambiguate types when they have the same name and need cast between each other.

This commit is contained in:
Christoffer Lerno
2025-08-31 15:16:52 +02:00
parent c0387221af
commit c7f09f2879
5 changed files with 121 additions and 6 deletions

View File

@@ -0,0 +1,15 @@
module foo::a;
struct Lexer { int a; }
fn void foo(Lexer *lex) {}
module foo::b;
struct Lexer { int a; }
fn void foo(Lexer *lex) {}
module foo;
fn void bar()
{
a::Lexer l;
b::foo(&l); // #error: Implicitly casting 'foo::a::Lexer*' to 'foo::b::Lexer*' is not permitted, but you may do an explicit cast by placing '(foo::b::Lexer*)' before the expression
}