__ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
-__ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1;
+__ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
}), __ecereInstance2;
});
break;
struct Expression * c;
struct Context * context = PushContext();
+if(_class->templateClass && !strcmp(_class->templateClass->name, "Container") && e->list && (*e->list).first && ((struct Expression *)(*e->list).first)->type == 11 && ((struct Expression *)(*e->list).first)->cast.exp && ((struct Expression *)(*e->list).first)->cast.exp->type == 4 && ((struct Expression *)(*e->list).first)->cast.exp->op.op == '&' && ((struct Expression *)(*e->list).first)->cast.exp->op.exp2 && ((struct Expression *)(*e->list).first)->cast.exp->op.exp2->type == 35)
+{
+__ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*exp->call.arguments), e->prev, MkExpIdentifier(MkIdentifier(className)));
+}
+else
+{
c = MkExpExtensionCompound(MkCompoundStmt(MkListOne(MkDeclaration(MkListOne(MkSpecifierName("Instance")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_ClassInst")), MkInitializerAssignment(CopyExpression(e)))))), MkListOne(MkExpressionStmt(MkListOne(MkExpCondition(MkExpIdentifier(MkIdentifier("__internal_ClassInst")), MkListOne(MkExpPointer(MkExpIdentifier(MkIdentifier("__internal_ClassInst")), MkIdentifier("_class"))), MkExpIdentifier(MkIdentifier(className))))))));
c->compound->compound.context = context;
PopContext(context);
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*exp->call.arguments), e->prev, c);
}
+}
else
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*exp->call.arguments), e->prev, MkExpIdentifier(MkIdentifier(className)));
}
// ({ Instance __internal_ClassInst = e; __internal_ClassInst ? __internal_ClassInst._class : __ecereClass_...; })
Expression c;
Context context = PushContext();
- c = MkExpExtensionCompound(MkCompoundStmt(
- MkListOne(MkDeclaration(
- MkListOne(MkSpecifierName("Instance")),
- MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_ClassInst")),
- MkInitializerAssignment(CopyExpression(e)))))),
- MkListOne(MkExpressionStmt(MkListOne(MkExpCondition(
- MkExpIdentifier(MkIdentifier("__internal_ClassInst")),
- MkListOne(MkExpPointer(MkExpIdentifier(MkIdentifier("__internal_ClassInst")), MkIdentifier("_class"))),
- MkExpIdentifier(MkIdentifier(className))))))));
- c.compound.compound.context = context;
- PopContext(context);
-
- exp.call.arguments->Insert(e.prev, c);
+
+ // Work around to avoid repeating the BuiltInContainer just to get the type
+ // (a bit messy since we already transformed our expression to an extensionInitializerExp in earlier pass)
+ if(_class.templateClass && !strcmp(_class.templateClass.name, "Container") &&
+ e.list && e.list->first &&
+ ((Expression)e.list->first).type == castExp &&
+ ((Expression)e.list->first).cast.exp &&
+ ((Expression)e.list->first).cast.exp.type == opExp &&
+ ((Expression)e.list->first).cast.exp.op.op == '&' &&
+ ((Expression)e.list->first).cast.exp.op.exp2 &&
+ ((Expression)e.list->first).cast.exp.op.exp2.type == extensionInitializerExp)
+ {
+ exp.call.arguments->Insert(e.prev, MkExpIdentifier(MkIdentifier(className)));
+ }
+ else
+ {
+ c = MkExpExtensionCompound(MkCompoundStmt(
+ MkListOne(MkDeclaration(
+ MkListOne(MkSpecifierName("Instance")),
+ MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_ClassInst")),
+ MkInitializerAssignment(CopyExpression(e)))))),
+ MkListOne(MkExpressionStmt(MkListOne(MkExpCondition(
+ MkExpIdentifier(MkIdentifier("__internal_ClassInst")),
+ MkListOne(MkExpPointer(MkExpIdentifier(MkIdentifier("__internal_ClassInst")), MkIdentifier("_class"))),
+ MkExpIdentifier(MkIdentifier(className))))))));
+ c.compound.compound.context = context;
+ PopContext(context);
+
+ exp.call.arguments->Insert(e.prev, c);
+ }
}
else
exp.call.arguments->Insert(e.prev, MkExpIdentifier(MkIdentifier(className)));