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

Optional value exceptions have no location in plugin arguments #8003

Open
bartv opened this issue Aug 26, 2024 · 0 comments
Open

Optional value exceptions have no location in plugin arguments #8003

bartv opened this issue Aug 26, 2024 · 0 comments
Labels
bug Something isn't working compiler usability This ticket is related to improved usability

Comments

@bartv
Copy link
Contributor

bartv commented Aug 26, 2024

When an optional value exception is raised, it gives the location where the variable was accessed. However, if this happens in the arguments of a plugin it does not mention them:

entity Test:
end

Test.host [0:1] -- std::Host

x = Test()
std::print(x.host)

This results in:

Error: Optional variable accessed that has no value (attribute `__config__::Test.host` of `__config__::Test (instantiated at ./test.cf:7)`)

It only mentions the line x was created, not where x.host happened. For other types of statements it is correct:

entity Test:

end

Test.host [0:1] -- std::Host

x = Test()
y = x.host
Error: Optional variable accessed that has no value (attribute `__config__::Test.host` of `__config__::Test (instantiated at ./test.cf:7)`) (reported in y = x.host (./test.cf:8))
@bartv bartv added the compiler label Aug 26, 2024
@sanderr sanderr added bug Something isn't working usability This ticket is related to improved usability labels Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler usability This ticket is related to improved usability
Projects
None yet
Development

No branches or pull requests

2 participants