w6c+selfhost: cross-module same-leaf type disambiguation via Sym.mod
This commit is contained in:
18
test/wcc/data/modcollision/pos.ww
Normal file
18
test/wcc/data/modcollision/pos.ww
Normal file
@@ -0,0 +1,18 @@
|
||||
// Positive case: two modules each export `type stream`. The consumer
|
||||
// imports both and disambiguates via the module qualifier. mod1.stream
|
||||
// has fields (a, b); mod2.stream has fields (c, d). The exit code
|
||||
// encodes a sum of all four fields, so any cross-binding would either
|
||||
// fail to compile or return the wrong value.
|
||||
|
||||
use mod1;
|
||||
use mod2;
|
||||
|
||||
fn main() i32 = {
|
||||
let s1: mod1.stream;
|
||||
s1.a = 3: i32;
|
||||
s1.b = 5: i32;
|
||||
let s2: mod2.stream;
|
||||
s2.c = 7: i32;
|
||||
s2.d = 11: i32;
|
||||
return s1.a + s1.b + s2.c + s2.d;
|
||||
};
|
||||
Reference in New Issue
Block a user