[SR-8549] Generic method fails to return type alias #51067
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
diagnostics QoI
Bug: Diagnostics Quality of Implementation
type checker
Area → compiler: Semantic analysis
Environment
Xcode Version 9.4.1 (9F2000)
Apple Swift version 4.1.2 (swiftlang-902.0.54 clang-902.0.39.2)
Target: x86_64-apple-darwin17.7.0
Additional Detail from JIRA
md5: 898e1db3a7ddbaf8770f56bbd4657549
Issue Description:
The following code fails to compile because the generic method returns an object of type "SomeClass" instead of "SomeAlias". This seems to be a bug because the block passed into the method returns "SomeAlias" and hence "genericMethod" should also return "SomeAlias".
Compiler error:
12:25: Value of type 'SomeClass' does not conform to specified type 'SomeAlias' (aka 'SomeClass & SomeProtocol')
The text was updated successfully, but these errors were encountered: