Skip to content

Instantly share code, notes, and snippets.

@lexuanquynh
Created June 16, 2025 08:52
Show Gist options
  • Save lexuanquynh/26fb4dc1679324b780b3185752006141 to your computer and use it in GitHub Desktop.
Save lexuanquynh/26fb4dc1679324b780b3185752006141 to your computer and use it in GitHub Desktop.
(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))))
// houseNo variable declaration
(var_decl range=[./employee.swift:4:9 - line:4:9] "houseNo" type='<null type>' readImpl=getter immutable
(accessor_decl range=[./employee.swift:4:24 - line:4:24] 'anonname=0x7fc1e408db80' get_for=houseNo
// Not recognized Int type
(parameter "self"./employee.swift:4:18: error: cannot find type 'Int' in scope
var houseNo: Int { get }
^~~
)
...
// Employee class declaration
(class_decl range=[./employee.swift:16:8 - line:31:1] "Employee" inherits: <null>
(pattern_binding_decl range=[./employee.swift:17:12 - line:17:27]
(pattern_typed
(pattern_named 'firstName')
(type_ident
(component id='String' bind=none))))
// Employee class vars declaration
(var_decl range=[./employee.swift:17:16 - line:17:16] "firstName" type='<null type>' let readImpl=stored immutable)
(pattern_binding_decl range=[./employee.swift:18:12 - line:18:26]
(pattern_typed
(pattern_named 'lastName')
(type_ident
(component id='String' bind=none))))
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment