-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
in generics, params and return can't call procs in for their type declaration; gives Error: type mismatch #15959
Comments
It is not lent specific. It is known fact that you can't use function calls in return type definition for generic procs. proc my[T](a: T): typeof(a[0]) =
discard
proc my2[T](a: T): array[sizeof(a[0]), T] =
discard |
lent type(expr)
gives Error: type mismatch
thanks for pointing this out, I've updated title + added Example 2 |
After #24005 we just need to update subscript sem to generate |
Example 1
lent type(expr)
gives Error: type mismatchCurrent Output
Expected Output
works
[EDIT] Example 2
Additional Information
notes
default values for optionals can call procs, unrestricted:
The text was updated successfully, but these errors were encountered: