tokay-lang / tokay

Tokay is a programming language designed for ad-hoc parsing, inspired by awk.
https://tokay.dev
MIT License
236 stars 7 forks source link

Confusing error message with redundant generic names #141

Open phorward opened 2 weeks ago

phorward commented 2 weeks ago

This script

Assignment : @<Expression, Assignment: Assignment, ext: void> {
    Ident _ '=' _ Expect<Assignment>  ast("assign" + ext)
    Expression  ast("value")
}

ast_print(Assignment<Int>)

generates the error messages

'Assignment' requires assignment of generic argument 'Expression'
'Assignment' requires assignment of generic argument 'Expression'

When, according to the error message hint, the script is changed into this version:

Assignment : @<Expression, Assignment: Assignment, ext: void> {
    Ident _ '=' _ Expect<Assignment<Int>>  ast("assign" + ext)
    Expression  ast("value")
}

ast_print(Assignment<Int>)

the error messages gets more confusing:

Line 2, column 26: Use of undefined name 'Assignment<Int>'