dyna icon indicating copy to clipboard operation
dyna copied to clipboard

bad parse for [3 | &foo]

Open jeisner opened this issue 12 years ago • 3 comments

The rule a = [3 | 4]' gets an errorMalformed list a = &cons(3,4), which is correct (except that I thought we weren't exposing cons anymore?).

But b = [3 | &foo] gets an incorrect error that shows that it oddly interprets | as the boolean operator rather than as the list pipe:

Failed to initialize rule:
    b = [3 | &foo].
  due to ``|` expected Boolean arguments, got `int` and `Term``
    b = [(3 | &foo)=?].

jeisner avatar Jul 25 '13 17:07 jeisner

The parsing error is the same issue as #53.

timvieira avatar Jul 25 '13 17:07 timvieira

I don't know how not to expose cons in this instance. It ought to be a type error, but alas no static type checking hence the error message.

timvieira avatar Jul 25 '13 17:07 timvieira

Currently it gives different error message:

> a = [3 | 4] .
>>> 1 new errors. Type `sol` for details.

> sol
Solution empty.

Errors
======
Uninitialized rules
===================
Failed to initialize rule:
    a = [3 | 4] .
  due to `Malformed list`
    a = &cons(3, 4).

kosiakk avatar Dec 04 '13 16:12 kosiakk