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

Function TypeArgumentType

NULLC/includes/typeinfo.cpp:233–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231 }
232
233 TypeID TypeArgumentType(int argument, int &typeID)
234 {
235 assert(linker);
236 ExternTypeInfo &type = linker->exTypes[typeID];
237 if(type.subCat != ExternTypeInfo::CAT_FUNCTION)
238 {
239 nullcThrowError("typeid::argumentType received type (%s) that is not a function", &linker->exSymbols[type.offsetToName]);
240 return getTypeID(0);
241 }
242 if((unsigned int)argument >= type.memberCount)
243 {
244 nullcThrowError("typeid::argumentType: argument number illegal, function (%s) has only %d argument(s)", &linker->exSymbols[type.offsetToName], type.memberCount);
245 return getTypeID(0);
246 }
247 unsigned int *memberList = &linker->exTypeExtra[0];
248 return getTypeID(memberList[type.memberOffset + argument + 1]);
249 }
250}
251
252#define REGISTER_FUNC(funcPtr, name, index) if(!nullcBindModuleFunction("std.typeinfo", (void(*)())NULLCTypeInfo::funcPtr, name, index)) return false;

Callers

nothing calls this directly

Calls 3

assertFunction · 0.85
getTypeIDFunction · 0.85
nullcThrowErrorFunction · 0.50

Tested by

no test coverage detected