From 7d77f7247ce71d4d9714220e6c36a460fa3e78d2 Mon Sep 17 00:00:00 2001 From: Rudy Ges Date: Sun, 21 Jul 2024 13:37:32 +0200 Subject: [PATCH 1/2] Use whole import position when storing subtype import resolution data --- src/context/display/importHandling.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/context/display/importHandling.ml b/src/context/display/importHandling.ml index 92fabf2b902..1b16393165e 100644 --- a/src/context/display/importHandling.ml +++ b/src/context/display/importHandling.ml @@ -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 () = From 24839acd61612413c9fc384253acadf1b139a8cc Mon Sep 17 00:00:00 2001 From: Rudy Ges Date: Sun, 21 Jul 2024 13:43:59 +0200 Subject: [PATCH 2/2] [tests] add test for 11620 --- tests/display/src/cases/Issue11620.hx | 14 ++++++++++++++ tests/display/src/misc/issue11620/Foo.hx | 9 +++++++++ 2 files changed, 23 insertions(+) create mode 100644 tests/display/src/cases/Issue11620.hx create mode 100644 tests/display/src/misc/issue11620/Foo.hx diff --git a/tests/display/src/cases/Issue11620.hx b/tests/display/src/cases/Issue11620.hx new file mode 100644 index 00000000000..d6544981152 --- /dev/null +++ b/tests/display/src/cases/Issue11620.hx @@ -0,0 +1,14 @@ +package cases; + +class Issue11620 extends DisplayTestCase { + /** + import misc.issue11620.Foo.Bar; + + function main() { + Bar.bar(); + } + **/ + function test() { + arrayEq([], diagnostics()); + } +} diff --git a/tests/display/src/misc/issue11620/Foo.hx b/tests/display/src/misc/issue11620/Foo.hx new file mode 100644 index 00000000000..10a73dd56f9 --- /dev/null +++ b/tests/display/src/misc/issue11620/Foo.hx @@ -0,0 +1,9 @@ +package misc.issue11620; + +class Foo { + public static function foo() {} +} + +class Bar { + public static function bar() {} +}