Fix partial function prototypes not sharing their instances

This also made it necessary to extend the internal per-function instances map by one level for the respective class instance key so functions on differnt class instances with the same own type arguments don't collide.
This commit is contained in:
dcodeIO
2018-12-01 19:46:10 +01:00
parent 0e33806cf6
commit 4c35dd6f7c
4 changed files with 29 additions and 17 deletions

View File

@ -2391,8 +2391,8 @@ export class FunctionPrototype extends Element {
declaration: FunctionDeclaration;
/** If an instance method, the class prototype reference. */
classPrototype: ClassPrototype | null;
/** Resolved instances. */
instances: Map<string,Function> = new Map();
/** Resolved instances by class type arguments and function type arguments. */
instances: Map<string,Map<string,Function>> = new Map();
/** Class type arguments, if a partially resolved method of a generic class. Not set otherwise. */
classTypeArguments: Type[] | null = null;
/** Operator kind, if an overload. */