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

Enumerated Ambiguous Use #124

Open
MattTimmons opened this issue Apr 5, 2023 · 3 comments
Open

Enumerated Ambiguous Use #124

MattTimmons opened this issue Apr 5, 2023 · 3 comments

Comments

@MattTimmons
Copy link

Xcode 14.3 is throwing
Ambiguous use of 'enumerateAsArray'

with

do {
            // As a string, guessing the delimiter
            let csv: CSV = try CSV<Enumerated>(string: "id,name,age\n1,Alice,18")

            csv.enumerateAsArray { array in
                print(array.first)
            }
            
        } catch let parseError as CSVParseError {
            // Catch errors from parsing invalid CSV
        } catch {
            // Catch errors from trying to load files
        }

Ideas?

@MattTimmons MattTimmons changed the title Enumerated Ambigious Usew Enumerated Ambiguous Usew Apr 5, 2023
@MattTimmons MattTimmons changed the title Enumerated Ambiguous Usew Enumerated Ambiguous Use Apr 5, 2023
@dagronf
Copy link

dagronf commented Jun 3, 2023

@MattTimmons

There are two enumerateAsArray calls that both have all parameters as default or optional. As a result, calling enumerateAsArray with no parameters as per the README example won't be able to determine which variant to call, as they both end up with the same signature.

My workaround was to use

try csv.enumerateAsArray(rowLimit: Int.max) { array in ...

@DivineDominion
Copy link
Contributor

Thanks for spotting this, folks! @dagronf @MattTimmons I'd be happy to merge a PR that addresses this public API issue in a sensible way 👍

@chezchez
Copy link

Thanks dagronf!
That workaround did it for me.

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

4 participants