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

Implicit multiplication with parens: improve error message #532

Open
sharkdp opened this issue Aug 13, 2024 · 0 comments
Open

Implicit multiplication with parens: improve error message #532

sharkdp opened this issue Aug 13, 2024 · 0 comments
Labels

Comments

@sharkdp
Copy link
Owner

sharkdp commented Aug 13, 2024

This happens frequently. Someone tries to use implicit multiplication with a factor in parens. This doesn't work and is parsed as a function call pi(…).

>>> 2 pi (3 / 4)
error: Could not solve the following constraints:
  Scalar ~ Fn[(Scalar) -> T288
.. while trying to infer types in the (elaborated) statement:
  2 × pi(3 / 4)
]
 = Consider adding type annotations to get more precise error messages.

We should not show a constraint-solver error message in this case but rather catch it directly and show a good error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant