mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-07-21 09:12:14 +00:00
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:
@@ -551,13 +551,15 @@ export class Compiler extends DiagnosticEmitter {
|
||||
|
||||
// skip prototype and export instances
|
||||
case ElementKind.FUNCTION_PROTOTYPE: {
|
||||
for (let instance of (<FunctionPrototype>element).instances.values()) {
|
||||
let instanceName = name;
|
||||
if (instance.is(CommonFlags.GENERIC)) {
|
||||
let fullName = instance.internalName;
|
||||
instanceName += fullName.substring(fullName.lastIndexOf("<"));
|
||||
for (let instances of (<FunctionPrototype>element).instances.values()) {
|
||||
for (let instance of instances.values()) {
|
||||
let instanceName = name;
|
||||
if (instance.is(CommonFlags.GENERIC)) {
|
||||
let fullName = instance.internalName;
|
||||
instanceName += fullName.substring(fullName.lastIndexOf("<"));
|
||||
}
|
||||
this.makeModuleExport(instanceName, instance, prefix);
|
||||
}
|
||||
this.makeModuleExport(instanceName, instance, prefix);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user