RblSb 4 月之前
父节点
当前提交
f96456548f
共有 2 个文件被更改,包括 35 次插入0 次删除
  1. 27 0
      tests/server/src/cases/issues/Issue11909.hx
  2. 8 0
      tests/server/test/templates/issues/Issue11909/Main.hx

+ 27 - 0
tests/server/src/cases/issues/Issue11909.hx

@@ -0,0 +1,27 @@
+package cases.issues;
+
+import haxe.display.Diagnostic;
+
+class Issue11909 extends TestCase {
+	function test(_) {
+		var content = getTemplate("issues/Issue11909/Main.hx");
+		var transform = Markers.parse(content);
+		vfs.putContent("Main.hx", transform.source);
+
+		var args = ["-main", "Main"];
+		runHaxe(args);
+		assertSuccess();
+
+		runHaxeJsonCb(args, DisplayMethods.Hover, {file: new FsPath("Main.hx"), offset: transform.offset(1)}, res -> {
+			switch (res.item.kind) {
+				case Local:
+					Assert.equals("int", res.item.args.name);
+					Assert.equals("Int", res.item.args.type.args.path.typeName);
+
+				case kind:
+					Assert.fail("unexpected item kind: " + kind);
+			}
+		});
+		assertSuccess();
+	}
+}

+ 8 - 0
tests/server/test/templates/issues/Issue11909/Main.hx

@@ -0,0 +1,8 @@
+class Main {
+	static function main() {
+		final in{-1-}t = foo();
+	}
+	static function foo(?pos:haxe.PosInfos):Int {
+		return 0;
+	}
+}