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

Type unsafety with range[enum] #13200

Closed
ghost opened this issue Jan 20, 2020 · 0 comments · Fixed by #13204
Closed

Type unsafety with range[enum] #13200

ghost opened this issue Jan 20, 2020 · 0 comments · Fixed by #13204

Comments

@ghost
Copy link

ghost commented Jan 20, 2020

Example

type KindA = enum A, B, C
type SubKindA = range[A .. B]
type KindB = enum UnrelatedSymbol
proc test(kind: SubKindA) = discard
test(UnrelatedSymbol)

Expected Output

Type mismatch error

Possible Solution

Will see about making a PR. Fix seems easy

@ghost ghost changed the title Type unsafety with range[pure enum] that shares symbol with normal enum Type unsafety with range[enum] Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant