mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
The goal here is to make the short demangling as short and readable as possible, also at the cost of omitting some information. The assumption is that whenever the short demangling is displayed, there is a way for the user to also get the full demangled name if needed. *) omit <where ...> because it does not give useful information anyway Deserializer.deserialize<A where ...> () throws -> [A] --> Deserializer.deserialize<A> () throws -> [A] *) for multiple specialized functions only emit a single “specialized” specialized specialized Constructible.create(A.Element) -> Constructible<A> --> specialized Constructible.create(A.Element) -> Constructible<A> *) Don’t print function argument types: foo(Int, Double, named: Int) --> foo(_:_:named:) This is a trade-off, because it can lead to ambiguity if there are overloads with different types. *) make contexts of closures, local functions, etc. more readable by using “<a> in <b>” syntax This is also done for the full and not only for the simplified demangling. Renderer.(renderInlines([Inline]) -> String).(closure #1) --> closure #1 in Renderer.renderInlines *) change spacing, so that it matches our coding style: foo <A> (x : A) --> foo<A>(x: A)
31 lines
606 B
Swift
31 lines
606 B
Swift
// RUN: %target-swift-frontend -emit-silgen %s | %FileCheck %s
|
|
|
|
func use<T>(_: T) {}
|
|
|
|
// CHECK-LABEL: sil hidden @_T022generic_local_property3fooyx1x_Si1ytlF
|
|
func foo<T>(x: T, y: Int) {
|
|
var mutable: Int {
|
|
get {
|
|
use(x)
|
|
return y
|
|
}
|
|
set {
|
|
use(x)
|
|
}
|
|
}
|
|
|
|
var readonly: Int {
|
|
get {
|
|
use(x)
|
|
return y
|
|
}
|
|
}
|
|
|
|
// CHECK-LABEL: function_ref getter of readonly #1 in foo<A>(x:y:)
|
|
_ = readonly
|
|
// CHECK-LABEL: function_ref getter of mutable #1 in foo<A>(x:y:)
|
|
_ = mutable
|
|
// CHECK-LABEL: function_ref setter of mutable #1 in foo<A>(x:y:)
|
|
mutable = y
|
|
}
|