{"action":"closed","issue":{"url":"https://api.github.com/repos/sq/JSIL/issues/903","labels_url":"https://api.github.com/repos/sq/JSIL/issues/903/labels{/name}","comments_url":"https://api.github.com/repos/sq/JSIL/issues/903/comments","events_url":"https://api.github.com/repos/sq/JSIL/issues/903/events","html_url":"https://github.com/sq/JSIL/issues/903","id":116678094,"number":903,"title":"Generic method resolution for compound generic broken","user":{"login":"iskiselev","id":5084964,"avatar_url":"https://avatars.githubusercontent.com/u/5084964?v=3","gravatar_id":"","url":"https://api.github.com/users/iskiselev","html_url":"https://github.com/iskiselev","followers_url":"https://api.github.com/users/iskiselev/followers","following_url":"https://api.github.com/users/iskiselev/following{/other_user}","gists_url":"https://api.github.com/users/iskiselev/gists{/gist_id}","starred_url":"https://api.github.com/users/iskiselev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iskiselev/subscriptions","organizations_url":"https://api.github.com/users/iskiselev/orgs","repos_url":"https://api.github.com/users/iskiselev/repos","events_url":"https://api.github.com/users/iskiselev/events{/privacy}","received_events_url":"https://api.github.com/users/iskiselev/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sq/JSIL/labels/Bug","name":"Bug","color":"e10c02"},{"url":"https://api.github.com/repos/sq/JSIL/labels/Missing%20Feature","name":"Missing Feature","color":"02d7e1"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-13T01:07:10Z","updated_at":"2015-11-16T05:13:10Z","closed_at":"2015-11-16T05:13:10Z","body":"Test case:\r\n```\r\nusing System;\r\nusing JSIL.Meta;\r\n\r\npublic static class Program {\r\n    public static void Main (string[] args) {\r\n        var s = \"a\";\r\n        OverloadedMethod(ref s);\r\n        OverloadedMethod(new[] { \"a\", \"b\" });\r\n        OverloadedMethod(new G<string>());\r\n    }\r\n\r\n    [JSRuntimeDispatch]\r\n    public static void OverloadedMethod<T> (ref T t) {\r\n        Console.WriteLine(\"OverloadedMethod<{0}>(ref <T>)\", typeof(T));\r\n    }\r\n\r\n    [JSRuntimeDispatch]\r\n    public static void OverloadedMethod<T> (T[] t) {\r\n        Console.WriteLine(\"OverloadedMethod<{0}>(<T[]>)\", typeof(T));\r\n    }\r\n\r\n\r\n    [JSRuntimeDispatch]\r\n    public static void OverloadedMethod<T>(G<T> t)\r\n    {\r\n        Console.WriteLine(\"OverloadedMethod<{0}>(<G<T>>)\", typeof(T));\r\n    }\r\n}\r\n\r\npublic class G<T>\r\n{\r\n}\r\n```\r\n\r\nLast call `OverloadedMethod(new G<string>());` will fail. Root cause here:\r\n```\r\nJSIL.ResolvedMethodSignature.prototype.ResolvePositionalGenericParameter = function (genericParameterValues, parameter) {\r\n  if (\r\n    (typeof (parameter) === \"object\") &&\r\n    (parameter !== null) &&\r\n    (Object.getPrototypeOf(parameter) === JSIL.PositionalGenericParameter.prototype)\r\n  ) {\r\n    return genericParameterValues[parameter.index] || null;\r\n  } else {\r\n    return parameter;\r\n  }\r\n};\r\n```\r\n\r\n`ResolvePositionalGenericParameter ` resolves only JSIL.PositionalGenericParameter, but really should try to resolve any open type.\r\n"}}