[SR-6977] NSObject inheritance causes: Error non-nominal type does not support explicit initialization #49525
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
Additional Detail from JIRA
md5: 4187fdb70abb1858fa5854feea50ed46
Issue Description:
I'm trying to instantiate a generic type which is constrained to be a protocol (which includes the init method), which is constrained be a concrete UIView subclass. However the init throws the compiler error: non-nominal type 'ViewType' does not support explicit initialization. This is only the case when we make Self: UIView. If we constrain Self to a non-NSObject, the code compiles.
Expanded upon in the Swift forums:
https://forums.swift.org/t/error-non-nominal-type-does-not-support-explicit-initialization/9195
The text was updated successfully, but these errors were encountered: