[SR-3616] Default implementation being called when specialized one should be picked #46201
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Environment
OS X El Capitan 10.11.6
Xcode 8.2 (8C38)
Swift 3 - default Xcode 8.2 toolchain
Additional Detail from JIRA
md5: 37d41da5c66e66345ea5bd0549666027
duplicates:
Issue Description:
The following code has unexpected results.
Results from the delegated functions seem to be wrong and the default implementation is being used. A way to workaround this is to implement the `test` method in the `BaseComponent` class. Then all child classes work as well.
I tried changing the `delegate` property type to `ComponentDelegate<ChildComponent>` and then forcefully casting `self` in the init, but this produces the same results = calling the default implementation.
Is this a bug in Swift or intended behavior? If it's an intended behavior, it seems a bit confusing to me and might be unnecessary constraining.
The text was updated successfully, but these errors were encountered: