|
@@ -53,10 +53,31 @@ class Issue10635 extends DisplayTestCase {
|
|
|
var contexts:Array<HaxeServerContext> = Json.parse(lastResult.stderr).result.result;
|
|
|
utest.Assert.equals(1, contexts.length);
|
|
|
var sig = contexts[0].signature;
|
|
|
- runHaxeJson(args, ServerMethods.Type, { signature: sig, modulePath: "GenericMethod", typeName: "GenericMethod"});
|
|
|
+ runHaxeJson(args, ServerMethods.Type, {signature: sig, modulePath: "GenericMethod", typeName: "GenericMethod"});
|
|
|
var type:JsonModuleType<JsonClass> = Json.parse(lastResult.stderr).result.result;
|
|
|
var statics = type.args.statics;
|
|
|
Assert.isTrue(statics.exists(cf -> cf.name == "f"));
|
|
|
Assert.isTrue(statics.exists(cf -> cf.name == "f_Class<Main>"));
|
|
|
}
|
|
|
-}
|
|
|
+
|
|
|
+ function testGenericInstanceAddition(_) {
|
|
|
+ var args = ["-main", "Main"];
|
|
|
+ vfs.putContent("GenericInstanceMethod.hx", getTemplate("GenericInstanceMethod.hx"));
|
|
|
+ vfs.putContent("Main.hx", getTemplate("issues/Issue10635/MainInstanceBefore.hx"));
|
|
|
+ runHaxe(args);
|
|
|
+ vfs.putContent("Main.hx", getTemplate("issues/Issue10635/MainInstanceAfter.hx"));
|
|
|
+ runHaxeJson([], ServerMethods.Invalidate, {file: new FsPath("Main.hx")});
|
|
|
+ // Note: We only have to run this once to reproduce because ServerMethods.Type will call cl_restore anyway
|
|
|
+ runHaxe(args);
|
|
|
+ var contexts = null;
|
|
|
+ runHaxeJsonCb(args, ServerMethods.Contexts, null, r -> contexts = r);
|
|
|
+ Assert.notNull(contexts);
|
|
|
+ utest.Assert.equals(1, contexts.length);
|
|
|
+ var sig = contexts[0].signature;
|
|
|
+ var type:JsonModuleType<JsonClass> = null;
|
|
|
+ runHaxeJsonCb(args, ServerMethods.Type, {signature: sig, modulePath: "GenericInstanceMethod", typeName: "GenericInstanceMethod"}, r -> type = r);
|
|
|
+ var fields = type.args.fields;
|
|
|
+ Assert.isTrue(fields.exists(cf -> cf.name == "f"));
|
|
|
+ Assert.isTrue(fields.exists(cf -> cf.name == "f_Class<Main>"));
|
|
|
+ }
|
|
|
+}
|