[SR-8801] SourceKit and -dump-ast report incorrect types for functions returning typealiases #51309
Labels
access control
Feature → modifiers: Access control and access levels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
regression
swift 4.2
Attachment: Download
Environment
Apple Swift version 4.2 (swiftlang-1000.11.37.1 clang-1000.11.45.1)
Target: x86_64-apple-darwin17.7.0
macos High Sierra, 10.13.6 (17G65)
Additional Detail from JIRA
md5: 110365d091ca8a63642e8cbbf698f0de
Issue Description:
In some situations, SourceKit cursor info/cmd+click in Xcode and `swiftc -dump-ast` report incorrect return type for functions that return typealises. In particular, the expanded type is reported instead of the typealias itself.
The expected behavior is that both would report function return type keeping the typealias as-is.
Notably, SourceKit and `swiftc -dump-ast` differ in behavior depending on where the typealias and the function is defined.
For more details, see the example below:
This behavior changed from Xcode 9.4.1 and 10. Swift 4.1.2 in the former reports all return types as the typealias, as expected.
The text was updated successfully, but these errors were encountered: