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

[SR-10022] Dictionary ambiguous reference to member 'count' #52425

Closed
SusanDoggie opened this issue Mar 1, 2019 · 4 comments
Closed

[SR-10022] Dictionary ambiguous reference to member 'count' #52425

SusanDoggie opened this issue Mar 1, 2019 · 4 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis

Comments

@SusanDoggie
Copy link
Contributor

Previous ID SR-10022
Radar None
Original Reporter @SusanDoggie
Type Bug
Environment

Xcode 10.2 beta 3

SwiftPM: swift-5.0-DEVELOPMENT-SNAPSHOT-2019-02-26-a

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, TypeChecker
Assignee None
Priority Medium

md5: 4fbbaaf3801035c97c3a75a631bbd0c3

Issue Description:

https://travis-ci.org/SusanDoggie/Doggie/jobs/499742696
https://travis-ci.org/SusanDoggie/Doggie/jobs/499757307

xcodebuild is successful. Only found the error with SwiftPM.

/Users/travis/build/SusanDoggie/Doggie/Sources/Doggie/Foundation/WeakDictionary.swift:94:21: error: ambiguous reference to member 'count'

return base.values.count { $0.key !== nil }

\~\~\~\~<sub>^</sub>\~\~\~\~

Swift.Dictionary\<τ_0\_0, τ_0\_1\>:32:31: note: found this candidate

@inlinable public var count: Int { get }

^

Swift.Collection:5:27: note: found this candidate

@inlinable public var count: Int { get }

@belkadan
Copy link
Contributor

belkadan commented Mar 1, 2019

SusanDoggie/Doggie@1d45fe1

@xedin, is this familiar?

@xedin
Copy link
Member

xedin commented Mar 4, 2019

Unfortunately `count(where: )` has been reverted. @moiseev are there any alternatives in stdlib?

@moiseev
Copy link
Mannequin

moiseev mannequin commented Mar 4, 2019

`xs.count(where: predicate)` should be equivalent to `xs.lazy.filter(predicate).count` when `xs` is a `Collection`.

@theblixguy
Copy link
Collaborator

Xcode 10.2 beta 4 change-log mentions that `count` has been removed and provides an alternative way to perform the same job. https://developer.apple.com/documentation/xcode_release_notes/xcode_10_2\_beta_4\_release_notes/swift_5\_release_notes_for_xcode_10_2\_beta_4?preferredLanguage=occ

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

4 participants