MCPcopy Create free account
hub / github.com/WheretIB/nullc / FinishConstructorCall

Function FinishConstructorCall

NULLC/Callbacks.cpp:2772–2782  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2770}
2771
2772void FinishConstructorCall(const char* pos)
2773{
2774 // Constructor return type must be void
2775 if(CodeInfo::nodeList.back()->typeInfo != typeVoid)
2776 ThrowError(pos, "ERROR: constructor cannot be used after 'new' expression if return type is not void");
2777
2778 // Wrap allocation, and variable pointer copy node and constructor call node into one
2779 TypeInfo *resultType = CodeInfo::nodeList[CodeInfo::nodeList.size()-2]->typeInfo;
2780 AddTwoExpressionNode(resultType);
2781 AddTwoExpressionNode(resultType);
2782}
2783
2784const char* FindConstructorName(TypeInfo* type)
2785{

Callers 1

ParseTerminalFunction · 0.85

Calls 3

ThrowErrorFunction · 0.85
AddTwoExpressionNodeFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected