Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing parse error about test_proc impl #1762

Open
mikex-oss opened this issue Dec 3, 2024 · 0 comments
Open

Confusing parse error about test_proc impl #1762

mikex-oss opened this issue Dec 3, 2024 · 0 comments
Labels
dslx:fmt DSLX auto-formatter dslx DSLX (domain specific language) implementation / front-end

Comments

@mikex-oss
Copy link
Collaborator

Describe the bug
The parser/formatter provides an error explaining that impls are not supported in test procs, even though that's not related to the actual issue.

To Reproduce

#[test_proc]
proc foo_test { }

Formatting failed: Error: INVALID_ARGUMENT: ParseError:test.x:1:13-2:18 Test proc with impl is not yet supported at test.x:1:13-2:18
=== Source Location Trace: ===
xls/dslx/frontend/bindings.h:58
xls/dslx/frontend/parser.cc:416
xls/dslx/parse_and_typecheck.cc:71
xls/dslx/dslx_fmt.cc:91

Expected behavior
I expect the real issue to be that config/init/next are not defined. The correct error is provided when specifying at least one of these:

#[test_proc]
proc foo_test {

  config() {}

 }

Formatting failed: Error: INVALID_ARGUMENT: ParseError: test.x:2:1-6:2 Procs must define init, config and next functions; missing: init, next.
=== Source Location Trace: ===
xls/dslx/frontend/bindings.h:58
xls/dslx/frontend/parser.cc:3557
xls/dslx/frontend/parser.cc:416
xls/dslx/parse_and_typecheck.cc:71
xls/dslx/dslx_fmt.cc:91

@mikex-oss mikex-oss added dslx DSLX (domain specific language) implementation / front-end dslx:fmt DSLX auto-formatter labels Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dslx:fmt DSLX auto-formatter dslx DSLX (domain specific language) implementation / front-end
Projects
Status: No status
Development

No branches or pull requests

1 participant