Skip to content

Extensions of generic type aliases are not fully implemented #47452

@rintaro

Description

@rintaro
mannequin
Previous ID SR-4875
Radar None
Original Reporter @rintaro
Type Bug
Environment

Xcode8.3.2

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

md5: f1ef05c08a6589e24bf54d7f026401f0

Issue Description:

struct Foo<K,V> {
    var k: K
    var v: V
}

typealias IntFoo<V> = Foo<Int, V>

extension IntFoo where V == Int {
    func f() {
        print(k)
    }
}

Foo(k: "test", v: 1).f()

This should be rejected as:
constrained extension must be declared on the unspecialized generic type 'Foo' with constraints specified by a 'where' clause

Metadata

Metadata

Assignees

Labels

accepts invalidBug: Accepts invalidbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itself

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions