Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check command #947

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
14 changes: 7 additions & 7 deletions Source/Concurrency/LinearTypeChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -764,23 +764,23 @@ private void CheckLinearStoreAccessInGuards()
while (stmtLists.Count > 0)
{
var stmtList = stmtLists.Pop();
stmtList.BigBlocks.Where(bigBlock => bigBlock.ec != null).ForEach(bigBlock => {
switch (bigBlock.ec) {
stmtList.BigBlocks.Where(bigBlock => bigBlock.Ec != null).ForEach(bigBlock => {
switch (bigBlock.Ec) {
case IfCmd ifCmd:
void ProcessIfCmd(IfCmd ifCmd)
{
if (ifCmd.Guard != null && LinearStoreVisitor.HasLinearStoreAccess(ifCmd.Guard))
{
checkingContext.Error(ifCmd.tok, "access to linear store not allowed");
}
stmtLists.Push(ifCmd.thn);
if (ifCmd.elseIf != null)
stmtLists.Push(ifCmd.Thn);
if (ifCmd.ElseIf != null)
{
ProcessIfCmd(ifCmd.elseIf);
ProcessIfCmd(ifCmd.ElseIf);
}
else if (ifCmd.elseBlock != null)
else if (ifCmd.ElseBlock != null)
{
stmtLists.Push(ifCmd.elseBlock);
stmtLists.Push(ifCmd.ElseBlock);
}
}
ProcessIfCmd(ifCmd);
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/AST/Absy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,7 @@ void ObjectInvariant()
Contract.Invariant(this.typedIdent != null);
}

public Variable(IToken tok, TypedIdent typedIdent)
protected Variable(IToken tok, TypedIdent typedIdent)
: base(tok, typedIdent.Name)
{
Contract.Requires(tok != null);
Expand All @@ -1304,6 +1304,7 @@ public Variable(IToken tok, TypedIdent typedIdent, QKeyValue kv)
}

public abstract bool IsMutable { get; }
public bool Monotonic { get; }

public override void Emit(TokenTextWriter stream, int level)
{
Expand Down
Loading
Loading