Skip to content

Instantly share code, notes, and snippets.

@lexuanquynh
Created June 16, 2025 08:55
Show Gist options
  • Save lexuanquynh/6fd4f0a6fd4f28ee810777d78d06d24f to your computer and use it in GitHub Desktop.
Save lexuanquynh/6fd4f0a6fd4f28ee810777d78d06d24f to your computer and use it in GitHub Desktop.
// 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
(pattern_binding_decl range=[./employee.swift:34:12 - line:34:25]
(pattern_typed type='Int'
(pattern_named type='Int' 'houseNo')
(type_ident
(component id='Int' bind=Swift.(file).Int))))
// Variable declaration on EmployeeAddress
(var_decl range=[./employee.swift:34:16 - line:34:16] "houseNo" type='Int' interface type='Int' access=public let readImpl=stored immutable
(accessor_decl implicit range=[./employee.swift:34:16 - line:34:16] 'anonname=0x7fd2821409e8' interface type='(EmployeeAddress) -> () -> Int' access=public get_for=houseNo
(parameter "self" type='EmployeeAddress' interface type='EmployeeAddress')
(parameter_list)
(brace_stmt implicit range=[./employee.swift:34:16 - line:34:16]
(return_stmt implicit
(member_ref_expr implicit type='Int' decl=employee.(file).EmployeeAddress.houseNo@./employee.swift:34:16 direct_to_storage
(declref_expr implicit type='EmployeeAddress' decl=employee.(file).EmployeeAddress.<anonymous>.self@./employee.swift:34:16 function_ref=unapplied))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment