mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
2f58b7c57a
This change fixes rdar://172417385 and #45125 by using transformRec to set no escape, instead of casting which drops sugar. This affects how interfaces are printed, and could theoretically cause issues with printing private aliases into public interfaces. Motivated by needing to be able to diagnose issues with attributes on aliases; without this change, the alias sugar is sometimes lost.
21 lines
688 B
Swift
21 lines
688 B
Swift
typealias MyFnTy = Int -> Int
|
|
class C {
|
|
func foo(_ x: Int ->Int) {}
|
|
func foo2(_ x: MyFnTy) {}
|
|
}
|
|
|
|
C().
|
|
|
|
// RUN: %sourcekitd-test -req=complete -pos=7:5 %s -- %s | %FileCheck %s
|
|
|
|
// CHECK: key.kind: source.lang.swift.decl.function.method.instance,
|
|
// CHECK-NEXT: key.name: "foo(:)",
|
|
// CHECK-NEXT: key.description: "foo(x: (Int) -> Int)",
|
|
// CHECK-NEXT: key.typename: "Void",
|
|
// CHECK: key.sourcetext: "foo(<#T##x: (Int) -> Int##(Int) -> Int#>)"
|
|
|
|
// CHECK: key.kind: source.lang.swift.decl.function.method.instance,
|
|
// CHECK-NEXT: key.name: "foo2(:)",
|
|
// CHECK-NEXT: key.description: "foo2(x: MyFnTy)",
|
|
// CHECK: key.sourcetext: "foo2(<#T##x: MyFnTy##MyFnTy##(Int) -> Int#>)"
|