19 lines
513 B
Plaintext
19 lines
513 B
Plaintext
// 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;
|
|
};
|