soabase / soabase-halva

Idiomatic Scala ... in Java
https://github.com/soabase/soabase-halva/blob/master/README.md
Apache License 2.0
81 stars 5 forks source link

exception with set() expression #6

Closed Randgalt closed 8 years ago

Randgalt commented 8 years ago
        Any<Integer> i = anyInt.define();
        Any<Integer> j = anyInt.define();
        Any<Integer> from = anyInt.define();
        For(i, IntStream.range(1, 3))
            .set(() -> from.set(4 - i.val()))
            .and(j, () -> Iterable(IntStream.range(from.val(), 3)))
            .unit(() -> System.out.println((10 * i.val() + j.val()) + " "));

Produces

java.lang.IllegalArgumentException: No value set for: Any(class java.lang.Integer) value: null