1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

Fixed 'ref let' case

This commit is contained in:
Brian Fiete 2020-07-16 16:03:05 -07:00
parent 7f31b29607
commit c11449f9db

View file

@ -3021,16 +3021,16 @@ int BfResolvedTypeSet::Hash(BfTypeReference* typeRef, LookupContext* ctx, BfHash
else if (auto varType = BfNodeDynCastExact<BfVarTypeReference>(typeRef)) else if (auto varType = BfNodeDynCastExact<BfVarTypeReference>(typeRef))
{ {
// Don't allow 'var' // Don't allow 'var'
//*failed = true; ctx->mModule->Fail("Invalid use of 'var'", typeRef);
auto primType = ctx->mModule->GetPrimitiveType(BfTypeCode_Var); ctx->mFailed = true;
return Hash(primType, ctx); return 0;
} }
else if (auto letType = BfNodeDynCastExact<BfLetTypeReference>(typeRef)) else if (auto letType = BfNodeDynCastExact<BfLetTypeReference>(typeRef))
{ {
// Don't allow 'let' // Don't allow 'let'
ctx->mModule->Fail("Invalid use of 'let'", typeRef);
ctx->mFailed = true; ctx->mFailed = true;
auto primType = ctx->mModule->GetPrimitiveType(BfTypeCode_Let); return 0;
return Hash(primType, ctx);
} }
else if (auto retTypeTypeRef = BfNodeDynCastExact<BfModifiedTypeRef>(typeRef)) else if (auto retTypeTypeRef = BfNodeDynCastExact<BfModifiedTypeRef>(typeRef))
{ {