Skip to content

[SR-9278] Unable to constrain a nested type which introduces no new generics #51750

@djehrlich

Description

@djehrlich
Previous ID SR-9278
Radar None
Original Reporter @djehrlich
Type Bug
Status Closed
Resolution Done
Environment

Xcode 10.1

Apple Swift version 4.2.1 (swiftlang-100.11.42 clang-1000.11.45.1)

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

md5: 7b4c5a4e94c7c3bf6e58535d54334a90

Issue Description:

class Outer<Channel> {
    class Generic<T> where Channel == Int {}
    class Nongeneric where Channel == Int {}
}

Should the “Nongeneric” inner class compile?

The “Generic” inner class compiles, but the “Nongeneric” inner class fails to compile with the error:

‘where’ clause cannot be attached to a non-generic declaration

Metadata

Metadata

Assignees

Labels

bugA 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