The following code [fails to compile](http://rise4fun.com/Dafny/Gplys):
```
class Foo
{
var bar:object;
}
predicate MyPredicate(foo:Foo)
requires foo != null;
reads foo;
requires foo.bar != null;
reads foo.bar;
{
true
}
```
It seems that the __requires__ clause should ensure that the __reads__ clause is confident that _foo.bar_ cannot be __null__.
A workaround that currently works is to use the following expression in the __reads__ clause:
```
reads if foo != null then {foo.bar} else {}
```
Thanks!
Comments: Bryan Parno has informed me that this behavior is by design and not a bug. My apologies for the false alarm. ~mlr
```
class Foo
{
var bar:object;
}
predicate MyPredicate(foo:Foo)
requires foo != null;
reads foo;
requires foo.bar != null;
reads foo.bar;
{
true
}
```
It seems that the __requires__ clause should ensure that the __reads__ clause is confident that _foo.bar_ cannot be __null__.
A workaround that currently works is to use the following expression in the __reads__ clause:
```
reads if foo != null then {foo.bar} else {}
```
Thanks!
Comments: Bryan Parno has informed me that this behavior is by design and not a bug. My apologies for the false alarm. ~mlr