FinishTemplatesContext(context);
// Mark parameters that were 'thisclass'
- /*{
+ {
Type p, op;
for(p = functionType.params.first, op = methodType.method.dataType.params.first; p && op; p = p.next, op = op.next)
- p.wasThisClass = op.kind == thisClassType;
- }*/
+ {
+ //p.wasThisClass = op.kind == thisClassType;
+ if(op.kind == thisClassType)
+ p.thisClassFrom = methodType.method._class;
+ }
+ }
+ if(methodType.method.dataType.returnType.kind == thisClassType)
+ {
+ // functionType.returnType.wasThisClass = true;
+ functionType.returnType.thisClassFrom = methodType.method._class;
+ }
}
FreeList(specs, FreeSpecifier);
kind = classType;
_class = prop ? prop._class.symbol : method ? method._class.symbol : _class.symbol;
// wasThisClass = type ? type.wasThisClass : false;
+ thisClassFrom = type ? type.thisClassFrom : null;
};
}
ClassTemplateArgument arg = tClass.templateArgs[id];
Context context = SetupTemplatesContext(tClass);
bool constant = exp.expType.constant;
+ bool passAsTemplate = false;
+ Class thisClassFrom = null;
+ Type t = ProcessTypeString(exp.expType.templateParameter.dataTypeString, false);
+ if(t && t.kind == classType && t._class)
+ thisClassFrom = t._class.registered;
+ FreeType(t);
+
+ passAsTemplate = tClass.templateClass && (exp.expType.kind != templateType ||
+ (!exp.expType.templateParameter || (!exp.expType.templateParameter.dataTypeString && !exp.expType.templateParameter.dataType)));
+
/*if(!arg.dataType)
arg.dataType = ProcessTypeString(arg.dataTypeString, false);*/
FreeType(exp.expType);
exp.expType = ProcessTypeString(arg.dataTypeString, false);
+ exp.expType.thisClassFrom = thisClassFrom;
if(exp.expType.kind == classType && constant) exp.expType.constant = true;
else if(exp.expType.kind == pointerType)
{
exp.expType = ReplaceThisClassType(_class);
}
- if(tClass.templateClass && (exp.expType.kind != templateType || (!exp.expType.templateParameter || (!exp.expType.templateParameter.dataTypeString && !exp.expType.templateParameter.dataType))))
+ if(passAsTemplate)
exp.expType.passAsTemplate = true;
//exp.expType.refCount++;
if(!exp.destType)