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

Do not allow base units of dimension 1 #308

Closed
sharkdp opened this issue Jan 31, 2024 · 0 comments · Fixed by #381
Closed

Do not allow base units of dimension 1 #308

sharkdp opened this issue Jan 31, 2024 · 0 comments · Fixed by #381
Labels
bug Something isn't working good first issue

Comments

@sharkdp
Copy link
Owner

sharkdp commented Jan 31, 2024

Defining base units of type Scalar/1 should not be possible:

unit page: Scalar

It is currently allowed, probably mostly harmless, but leads to weird runtime errors like

>>> page -> 1
error: runtime error
 = Conversion error: unit 'page' can not be converted to ''
@sharkdp sharkdp added bug Something isn't working good first issue labels Jan 31, 2024
sharkdp added a commit that referenced this issue Feb 24, 2024
Will now show a new error:

    >>> unit page: Scalar
    error: while type checking
      ┌─ <input:1>:1:6
      │
    1 │ unit page: Scalar
      │      ^^^^ Base units can not be dimensionless.
      │
      = Use 'unit page' for ad-hoc units.
      = Use 'unit page: Scalar = …' for derived units.

closes #308
sharkdp added a commit that referenced this issue Feb 24, 2024
Will now show a new error:

    >>> unit page: Scalar
    error: while type checking
      ┌─ <input:1>:1:6
      │
    1 │ unit page: Scalar
      │      ^^^^ Base units can not be dimensionless.
      │
      = Use 'unit page' for ad-hoc units.
      = Use 'unit page: Scalar = …' for derived units.

closes #308
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant