Skip to content

Instantly share code, notes, and snippets.

@mfelsche
Last active December 19, 2017 21:24
Show Gist options
  • Save mfelsche/39fc3d5424df942e889b6e9f50867268 to your computer and use it in GitHub Desktop.
Save mfelsche/39fc3d5424df942e889b6e9f50867268 to your computer and use it in GitHub Desktop.
pony AST error message for syntax pass on object literal
(class:scope
(id $1$0)
x
ref
(provides (nominal x (id Getter) x x x))
(members
(fvar (id d) (nominal (id $0) (id Bool) x val x x) x)
(fvar (id c) (nominal (id $0) (id Bool) x val x x) x)
(fvar (id b) (nominal (id $0) (id Bool) x val x x) x)
(fvar (id a) (nominal (id $0) (id Bool) x val x x) x)
(fun:scope
box
(id get)
x
x
(nominal x (id U64) x x x)
x
(seq
(call
(.
(call
(.
(call
(. (reference (id a)) (id op_and))
(positionalargs (seq (reference (id b))))
x
x
)
(id op_or)
)
(positionalargs (seq (reference (id c))))
x
x
)
(id op_and)
)
(positionalargs (seq (reference (id d))))
x
x
)
)
x
x
)
(new:scope
x
(id create)
x
(params
(param (id $1$1) (nominal (id $0) (id Bool) x val x x) x)
(param (id $1$2) (nominal (id $0) (id Bool) x val x x) x)
(param (id $1$3) (nominal (id $0) (id Bool) x val x x) x)
(param (id $1$4) (nominal (id $0) (id Bool) x val x x) x)
)
(nominal x (id $1$0) x x ^)
x
(seq
true
(= (reference (id a)) (consume x (reference (id $1$1))))
(= (reference (id b)) (consume x (reference (id $1$2))))
(= (reference (id c)) (consume x (reference (id $1$3))))
(= (reference (id d)) (consume x (reference (id $1$4))))
)
x
x
)
)
x
x
)
Error:
/home/mwahl/dev/pony/array_bug/test.pony:99:9: class constructor cannot specify return type
fun get(): U64 =>
^
(object
x
(provides (nominal (id $1) (id Getter) x ref x x))
(members
(fun:scope
x
(id get)
x
x
(nominal x (id U64) x x x)
x
(seq
(and
(or
(and (reference (id a)) (reference (id b)) x)
(reference (id c))
x
)
(reference (id d))
x
)
)
x
x
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment