Skip to content

Commit

Permalink
Use whole import position when storing subtype import resolution data (
Browse files Browse the repository at this point in the history
…#11732)

* Use whole import position when storing subtype import resolution data

* [tests] add test for 11620
  • Loading branch information
kLabz authored Jul 21, 2024
1 parent 87b7dbe commit 6ac4f47
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/context/display/importHandling.ml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ let init_import ctx path mode p =
check_alias tsub name pname;
Some name
in
ctx.m.import_resolution#add (module_type_resolution tsub alias p2);
ctx.m.import_resolution#add (module_type_resolution tsub alias p);
with Not_found ->
(* this might be a static property, wait later to check *)
let find_main_type_static () =
Expand Down
14 changes: 14 additions & 0 deletions tests/display/src/cases/Issue11620.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package cases;

class Issue11620 extends DisplayTestCase {
/**
import misc.issue11620.Foo.Bar;
function main() {
Bar.bar();
}
**/
function test() {
arrayEq([], diagnostics());
}
}
9 changes: 9 additions & 0 deletions tests/display/src/misc/issue11620/Foo.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package misc.issue11620;

class Foo {
public static function foo() {}
}

class Bar {
public static function bar() {}
}

0 comments on commit 6ac4f47

Please sign in to comment.