Skip to content

Commit faaebee

Browse files
authored
Fixed crash in type checker (#817) (#873)
1 parent 4093acc commit faaebee

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

src/main/scala/viper/silver/parser/Resolver.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ case class TypeChecker(names: NameAnalyser) {
833833
permBan = Some("forperm quantifier bodies")
834834
check(pq.body, Bool)
835835
permBan = oldPermBan
836-
checkInternal(pq.accessRes)
836+
checkTopTyped(pq.accessRes, None)
837837
pq.triggers foreach (_.exp.inner.toSeq foreach (tpe => checkTopTyped(tpe, None)))
838838
pq._typeSubstitutions = pq.body.typeSubstitutions.toList.distinct
839839
pq.typ = Bool
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Any copyright is dedicated to the Public Domain.
2+
// http://creativecommons.org/publicdomain/zero/1.0/
3+
4+
domain Pointer[] {
5+
}
6+
7+
domain F {
8+
function foo(bar: F): Ref
9+
}
10+
11+
field int: Int
12+
field f: F
13+
14+
function ptrDeref(p: Pointer[]): Ref
15+
16+
method baz()
17+
//:: ExpectedOutput(typechecker.error)
18+
ensures [true, (forperm this: Pointer[] [foo(ptrDeref(this).f).int] :: false)]

0 commit comments

Comments
 (0)