Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
shazqadeer committed Jan 3, 2024
1 parent 37f081f commit ea6af6f
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions Source/Core/AST/AbsyCmd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3319,8 +3319,13 @@ public override void Resolve(ResolutionContext rc)
// checking calls from atomic actions need type information, hence postponed to type checking
}

private void TypecheckCallCmdInYieldProcedureDecl(YieldProcedureDecl callerDecl, TypecheckingContext tc)
private void TypecheckCallCmdInYieldProcedureDecl(TypecheckingContext tc)
{
if (tc.Proc is not YieldProcedureDecl callerDecl)
{
return;
}

var callerModifiedVars = new HashSet<Variable>(callerDecl.ModifiedVars);

void CheckModifies(IEnumerable<Variable> modifiedVars)
Expand Down Expand Up @@ -3574,6 +3579,8 @@ public override void Typecheck(TypecheckingContext tc)
Contract.Assume(this.Proc !=
null); // we assume the CallCmd has been successfully resolved before calling this Typecheck method

var errorCount = tc.ErrorCount;

(this as ICarriesAttributes).TypecheckAttributes(tc);

List<LayerRange> expectedLayerRanges = null;
Expand Down Expand Up @@ -3647,12 +3654,6 @@ public override void Typecheck(TypecheckingContext tc)
}
}

// Type checking of layers requires call inputs to be resolved
if (tc.Proc is YieldProcedureDecl callerDecl1)
{
TypecheckCallCmdInYieldProcedureDecl(callerDecl1, tc);
}

this.CheckAssignments(tc);

List<Type> /*!*/
Expand Down Expand Up @@ -3693,6 +3694,11 @@ public override void Typecheck(TypecheckingContext tc)
TypeParameters = SimpleTypeParamInstantiation.From(Proc.TypeParameters,
actualTypeParams);

if (tc.ErrorCount > errorCount)
{
return;
}
TypecheckCallCmdInYieldProcedureDecl(tc);
TypecheckCallCmdInActionDecl(tc);
}

Expand Down

0 comments on commit ea6af6f

Please sign in to comment.