-
-
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
UFCS/MCS broken for routines accepting iterables (via untyped params) eg toSeq
#13595
Labels
Comments
it's not specific to toSeq, it's a sigmatch compiler limitation: template fun(a: untyped) = discard
iterator iter(): int = yield 10
fun(iter()) # ok
# iter().fun() # CT error IMO it's fixable (I had a POC for it IIRC). template fun(a: iterator {.inline.}) = discard
iterator iter(): int = yield 10
iter().fun() |
This was referenced Jun 23, 2020
timotheecour
changed the title
no UFCS support on
UFCS/MCS broken for routines with unytyped (eg iterables) params, eg Dec 17, 2020
toSeq
with tables keys
iteratortoSeq
timotheecour
changed the title
UFCS/MCS broken for routines with unytyped (eg iterables) params, eg
UFCS/MCS broken for routines accepting iterables (via untyped params) eg Dec 17, 2020
toSeq
toSeq
I understand that this problem is related to the same parser limitation
|
Except there is a solution for that |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
toSeq
-template of sequtils has no support for UFCS when using it together with thekeys
-iterator of tables.Example
Current Output
Expected Output
Expecting it to compile
Additional Information
echo toSeq(tab.keys)
works correctly:@["wednesday", "thursday", "saturday", "friday", "tuesday", "monday", "sunday"]
The text was updated successfully, but these errors were encountered: