Skip to content

[SR-13502] Have to place empty generics when using protocol + where cause in function #55944

@swift-ci

Description

@swift-ci
Previous ID SR-13502
Radar rdar://problem/68376692
Original Reporter mitchrobertson (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate
Environment

iOS/Mac

Additional Detail from JIRA
Votes 0
Component/s
Labels Bug
Assignee @slavapestov
Priority Medium

md5: 41befb185230425037d83439a0756f21

relates to:

Issue Description:

If we create a simple protocol with a type condition like this:

protocol FloatSequence: IteratorProtocol, Sequence where Element == CGFloat {
    var count: Int { get }
    func reset()
}

If I do a global operator overload like this, I have to use empty generics to get it to compile.

func -<FS: FloatSequence>(left: FS, right: FS) -> CGFloat {
    // TODO
}

Metadata

Metadata

Assignees

Labels

compilerThe Swift compiler itselfexistentialsFeature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased valuestype checkerArea → compiler: Semantic analysistypesFeature: types

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions