File tree Expand file tree Collapse file tree 4 files changed +27
-0
lines changed
resources/NameResolutionSuite/symbol_imports_same_name Expand file tree Collapse file tree 4 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -181,4 +181,22 @@ ut::suite<"NameResolution"> name_resolution_suite = [] {
181181 expect (a_ok.valueType () == Ark::ValueType::True) << " (and (= foo \" b:foo\" ) (= bar \" c:bar\" ))\n " ;
182182 };
183183 };
184+
185+ " [importing two symbols with the same name from two different files]" _test = [] {
186+ Ark::State state ({ lib_path });
187+
188+ should (" compile the resource without any error" ) = [&] {
189+ expect (mut (state).doFile (getResourcePath (" NameResolutionSuite/symbol_imports_same_name/a.ark" )));
190+ };
191+
192+ Ark::VM vm (state);
193+ should (" return exit code 0" ) = [&] {
194+ expect (mut (vm).run () == 0_i);
195+ };
196+
197+ should (" resolve symbols from all namespaces without generating bad fully qualified names" ) = [&] {
198+ const auto a_ok = mut (vm).operator [](" ok" );
199+ expect (a_ok.valueType () == Ark::ValueType::True) << " (and (= find \" b.ark\" ) (= b:find \" b.ark\" ) (= c:find \" c.ark\" ))\n " ;
200+ };
201+ };
184202};
Original file line number Diff line number Diff line change 1+ (import b :find)
2+ (import c :find)
3+
4+ (let ok (and (= find "b.ark") (= b:find "b.ark") (= c:find "c.ark")))
Original file line number Diff line number Diff line change 1+ (let find "b.ark")
Original file line number Diff line number Diff line change 1+ (let find "c.ark")
2+ (let test (fun () find))
3+
4+ (let bar "c:bar")
You can’t perform that action at this time.
0 commit comments