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

Type member typechecking error in boogie #364

Closed
samuelgruetter opened this issue Aug 24, 2019 · 0 comments · Fixed by #367
Closed

Type member typechecking error in boogie #364

samuelgruetter opened this issue Aug 24, 2019 · 0 comments · Fixed by #367

Comments

@samuelgruetter
Copy link
Collaborator

datatype NatOutcome =
| NatSuccess(value: nat)
| NatFailure(error: string)
{
    predicate method IsFailure() {
        this.NatFailure?
    }
        function method PropagateFailure(): NatOutcome requires IsFailure() {
        this
    }
        function method Extract(): nat requires !IsFailure() {
        this.value
    }
}

throws

C:/Users/kggruett/Documents/git/PR_Review/dafny/Test/exceptions/NatOutcomeDt.dfy(12,20): Error: internal error, shallow-type assignment was done incorrectly, this:ref != DatatypeType

Unhandled Exception: cce+UnreachableException: Exception of type 'cce+UnreachableException' was thrown.
   at Microsoft.Boogie.IdentifierExpr.Typecheck(TypecheckingContext tc) in C:\Users\kggruett\Documents\git\boogie\Source\Core\AbsyExpr.cs:line 1026
   at Microsoft.Boogie.NAryExpr.Typecheck(TypecheckingContext tc) in C:\Users\kggruett\Documents\git\boogie\Source\Core\AbsyExpr.cs:line 2570
   at Microsoft.Boogie.NAryExpr.Typecheck(TypecheckingContext tc) in C:\Users\kggruett\Documents\git\boogie\Source\Core\AbsyExpr.cs:line 2570
   at Microsoft.Boogie.AssumeCmd.Typecheck(TypecheckingContext tc) in C:\Users\kggruett\Documents\git\boogie\Source\Core\AbsyCmd.cs:line 3228
   at Microsoft.Boogie.Block.Typecheck(TypecheckingContext tc) in C:\Users\kggruett\Documents\git\boogie\Source\Core\AbsyCmd.cs:line 1093
   at Microsoft.Boogie.Implementation.Typecheck(TypecheckingContext tc) in C:\Users\kggruett\Documents\git\boogie\Source\Core\Absy.cs:line 3792
   at Microsoft.Boogie.Program.Typecheck(TypecheckingContext tc) in C:\Users\kggruett\Documents\git\boogie\Source\Core\Absy.cs:line 476
   at Microsoft.Boogie.Program.Typecheck(IErrorSink errorSink) in C:\Users\kggruett\Documents\git\boogie\Source\Core\Absy.cs:line 466
   at Microsoft.Boogie.Program.Typecheck() in C:\Users\kggruett\Documents\git\boogie\Source\Core\Absy.cs:line 461
   at Microsoft.Boogie.ExecutionEngine.ResolveAndTypecheck(Program program, String bplFileName, LinearTypeChecker& linearTypeChecker, CivlTypeChecker& civlTypeChecker) in C:\Users\kggruett\Documents\git\boogie\Source\ExecutionEngine\ExecutionEngine.cs:line 738
   at Microsoft.Dafny.DafnyDriver.BoogiePipelineWithRerun(Program program, String bplFileName, PipelineStatistics& stats, String programId) in C:\Users\kggruett\Documents\git\dafny\Source\DafnyDriver\DafnyDriver.cs:line 385
   at Microsoft.Dafny.DafnyDriver.BoogieOnce(String baseFile, String moduleName, Program boogieProgram, String programId, PipelineStatistics& stats, PipelineOutcome& oc) in C:\Users\kggruett\Documents\git\dafny\Source\DafnyDriver\DafnyDriver.cs:line 275
   at Microsoft.Dafny.DafnyDriver.Boogie(String baseName, IEnumerable`1 boogiePrograms, String programId, Dictionary`2& statss, PipelineOutcome& oc) in C:\Users\kggruett\Documents\git\dafny\Source\DafnyDriver\DafnyDriver.cs:line 296
   at Microsoft.Dafny.DafnyDriver.ProcessFiles(IList`1 dafnyFiles, ReadOnlyCollection`1 otherFileNames, ErrorReporter reporter, Boolean lookForSnapshots, String programId) in C:\Users\kggruett\Documents\git\dafny\Source\DafnyDriver\DafnyDriver.cs:line 213
   at Microsoft.Dafny.DafnyDriver.ThreadMain(String[] args) in C:\Users\kggruett\Documents\git\dafny\Source\DafnyDriver\DafnyDriver.cs:line 56
   at Microsoft.Dafny.DafnyDriver.<>c__DisplayClass1_0.<Main>b__0() in C:\Users\kggruett\Documents\git\dafny\Source\DafnyDriver\DafnyDriver.cs:line 33
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant