Skip to content

Instantly share code, notes, and snippets.

@lexuanquynh
Created June 16, 2025 08:59
Show Gist options
  • Save lexuanquynh/4f84d70a4f15df23e584ed8e5032f54a to your computer and use it in GitHub Desktop.
Save lexuanquynh/4f84d70a4f15df23e584ed8e5032f54a to your computer and use it in GitHub Desktop.
...
// protocol witness for Address.state.getter in conformance EmployeeAddress
sil shared [transparent] [serialized] [thunk] @$s8employee15EmployeeAddressVAA0C0A2aDP5stateSSvgTW : $@convention(witness_method: Address) (@in_guaranteed EmployeeAddress) -> @owned String {
// %0 // user: %1
bb0(%0 : $*EmployeeAddress):
%1 = load %0 : $*EmployeeAddress // user: %3
// function_ref EmployeeAddress.state.getter
%2 = function_ref @$s8employee15EmployeeAddressV5stateSSvg : $@convention(method) (@guaranteed EmployeeAddress) -> @owned String // user: %3
%3 = apply %2(%1) : $@convention(method) (@guaranteed EmployeeAddress) -> @owned String // user: %4
return %3 : $String // id: %4
} // end sil function '$s8employee15EmployeeAddressVAA0C0A2aDP5stateSSvgTW'
sil_vtable [serialized] Employee {
#Employee.init!allocator: (Employee.Type) -> (String, String, Address) -> Employee : @$s8employee8EmployeeC9firstName04lastD07addressACSS_SSAA7Address_ptcfC // Employee.__allocating_init(firstName:lastName:address:)
#Employee.printEmployeeInfo: (Employee) -> () -> () : @$s8employee8EmployeeC05printB4InfoyyF // Employee.printEmployeeInfo()
#Employee.deinit!deallocator: @$s8employee8EmployeeCfD // Employee.__deallocating_deinit
}
sil_witness_table [serialized] Employee: Person module employee {
method #Person.firstName!getter: <Self where Self : Person> (Self) -> () -> String : @$s8employee8EmployeeCAA6PersonA2aDP9firstNameSSvgTW // protocol witness for Person.firstName.getter in conformance Employee
method #Person.lastName!getter: <Self where Self : Person> (Self) -> () -> String : @$s8employee8EmployeeCAA6PersonA2aDP8lastNameSSvgTW // protocol witness for Person.lastName.getter in conformance Employee
method #Person.address!getter: <Self where Self : Person> (Self) -> () -> Address : @$s8employee8EmployeeCAA6PersonA2aDP7addressAA7Address_pvgTW // protocol witness for Person.address.getter in conformance Employee
}
sil_witness_table [serialized] EmployeeAddress: Address module employee {
method #Address.houseNo!getter: <Self where Self : Address> (Self) -> () -> Int : @$s8employee15EmployeeAddressVAA0C0A2aDP7houseNoSivgTW // protocol witness for Address.houseNo.getter in conformance EmployeeAddress
method #Address.street!getter: <Self where Self : Address> (Self) -> () -> String : @$s8employee15EmployeeAddressVAA0C0A2aDP6streetSSvgTW // protocol witness for Address.street.getter in conformance EmployeeAddress
method #Address.city!getter: <Self where Self : Address> (Self) -> () -> String : @$s8employee15EmployeeAddressVAA0C0A2aDP4citySSvgTW // protocol witness for Address.city.getter in conformance EmployeeAddress
method #Address.state!getter: <Self where Self : Address> (Self) -> () -> String : @$s8employee15EmployeeAddressVAA0C0A2aDP5stateSSvgTW // protocol witness for Address.state.getter in conformance EmployeeAddress
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment