mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 12:02:21 +02:00
Error checking for generic arg count in typeof
This commit is contained in:
parent
fb2e70c04a
commit
16c4ee40c6
1 changed files with 9 additions and 2 deletions
|
@ -9670,7 +9670,14 @@ BfType* BfModule::ResolveTypeRefAllowUnboundGenerics(BfTypeReference* typeRef, B
|
||||||
BfTypeVector typeVector;
|
BfTypeVector typeVector;
|
||||||
for (int i = 0; i < (int)genericTypeDef->mGenericParamDefs.size(); i++)
|
for (int i = 0; i < (int)genericTypeDef->mGenericParamDefs.size(); i++)
|
||||||
typeVector.push_back(GetGenericParamType(BfGenericParamKind_Type, i));
|
typeVector.push_back(GetGenericParamType(BfGenericParamKind_Type, i));
|
||||||
return ResolveTypeDef(genericTypeDef, typeVector, populateType);
|
auto result = ResolveTypeDef(genericTypeDef, typeVector, populateType);
|
||||||
|
if ((result != NULL) && (genericTypeRef->mCommas.size() + 1 != genericTypeDef->mGenericParamDefs.size()))
|
||||||
|
{
|
||||||
|
SetAndRestoreValue<BfTypeInstance*> prevTypeInstance(mCurTypeInstance, result->ToTypeInstance());
|
||||||
|
SetAndRestoreValue<BfMethodInstance*> prevMethodInstance(mCurMethodInstance, NULL);
|
||||||
|
Fail(StrFormat("Type '%s' requires %d generic arguments", TypeToString(result).c_str(), genericTypeDef->mGenericParamDefs.size()), typeRef);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue