Skip to content

Instantly share code, notes, and snippets.

View lexuanquynh's full-sized avatar
👋
coding ...

Quynh Le lexuanquynh

👋
coding ...
View GitHub Profile
dyld: Library not loaded: libEmployee.dylib
Referenced from: /Users/cyrilcermak/Programming/iOS/modular_architecture_on_ios/example/./main
Reason: image not found
[1] 92481 abort ./main
...
-emit-executable Emit a linked executable
-I <value> Add directory to the import search path
-L <value> Add directory to library link search path
-l<value> Specifies a library which should be linked against
...
380B Apr 2 13:36 Employee.swiftdoc
19K Apr 3 20:52 Employee.swiftmodule
2.9K Apr 3 20:52 Employee.swiftsourceinfo
1.1K Apr 3 20:52 employee.swift
57K Apr 3 20:52 libEmployee.dylib
...
entry:
%1 = getelementptr inbounds %__opaque_existential_type_1, %__opaque_existential_type_1* %0, i32 0, i32 1
%2 = load %swift.type*, %swift.type** %1, align 8
%3 = getelementptr inbounds %__opaque_existential_type_1, %__opaque_existential_type_1* %0, i32 0, i32 0
%4 = bitcast %swift.type* %2 to i8***
%5 = getelementptr inbounds i8**, i8*** %4, i64 -1
%.valueWitnesses = load i8**, i8*** %5, align 8, !invariant.load !64, !dereferenceable !65
%6 = bitcast i8** %.valueWitnesses to %swift.vwtable*
%7 = getelementptr inbounds %swift.vwtable, %swift.vwtable* %6, i32 0, i32 10
...
// 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
/employee.swift:4:18: error: cannot find type 'Foo' in scope
var houseNo: Foo { get }
^~~
(source_file "./employee.swift"
(import_decl range=[./employee.swift:1:1 - line:1:8] 'Foundation')
(protocol range=[./employee.swift:3:8 - line:8:1] "Address" <Self : Address> interface type='Address.Protocol' access=public non-resilient requirement signature=<Self>
(pattern_binding_decl range=[./employee.swift:4:5 - line:4:28]
(pattern_typed type='<<error type>>'
// Address protocol with resolved types
(protocol range=[./employee.swift:3:8 - line:8:1] "Address" <Self : Address> interface type='Address.Protocol' access=public non-resilient requirement signature=<Self>
(pattern_binding_decl range=[./employee.swift:4:5 - line:4:18] trailing_semi
(pattern_typed type='Int'
(pattern_named type='Int' 'houseNo')
(type_ident
(component id='Int' bind=Swift.(file).Int))))
...
// EmployeeAddress conforming to the Address protocol
(struct_decl range=[./employee.swift:33:8 - line:45:1] "EmployeeAddress" interface type='EmployeeAddress.Type' access=public non-resilient inherits: Address
public protocol Address {
var houseNo: Int; { get }
(source_file "./employee.swift"
// Importing Foundation
(import_decl range=[./employee.swift:1:1 - line:1:8] 'Foundation')
// Address protocol declaration
(protocol range=[./employee.swift:3:8 - line:8:1] "Address" <Self : Address> requirement signature=<null>
(pattern_binding_decl range=[./employee.swift:4:5 - line:4:28]
(pattern_typed
(pattern_named 'houseNo')
(type_ident
(component id='Int' bind=none))))
import Foundation
import Employee
let employee = Employee(firstName: "Cyril",
lastName: "Cermak",
address: EmployeeAddress(houseNo: 1, street: "PorschePlatz", city: "Stuttgart", state: "Germany"))
employee.printEmployeeInfo()