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

EnumX's type as a functions parameter #6

Closed
ArturPrzybysz opened this issue Nov 7, 2023 · 1 comment
Closed

EnumX's type as a functions parameter #6

ArturPrzybysz opened this issue Nov 7, 2023 · 1 comment

Comments

@ArturPrzybysz
Copy link

This behaviour is surprising:

julia> using EnumX

julia> @enumx A b c 

julia> A
Main.A

julia> f(a::A) = a
ERROR: ArgumentError: invalid type for argument a in method definition for f at REPL[15]:1
Stacktrace:
 [1] top-level scope
   @ REPL[15]:1

How to achieve what I am trying to?

@ArturPrzybysz
Copy link
Author

ArturPrzybysz commented Nov 7, 2023

Got it, it is:

julia> f(a::A.T) = a

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

No branches or pull requests

1 participant