Skip to content

Instantly share code, notes, and snippets.

@ukitaka
Created November 28, 2017 05:43
Show Gist options
  • Save ukitaka/4d56b185a133fcd1850af837ff9dccb0 to your computer and use it in GitHub Desktop.
Save ukitaka/4d56b185a133fcd1850af837ff9dccb0 to your computer and use it in GitHub Desktop.
sj;er
---Constraint solving for the expression at [sub.swift:4:11 - line:4:15]---
(increasing score due to function conversion)
(overload set choice binding ($T1) -> $T0 := () -> Dog)
---Initial constraints for the given expression---
(call_expr type='Dog' location=sub.swift:4:11 range=[sub.swift:4:11 - line:4:15] arg_labels=
(type_expr type='Dog.Type' location=sub.swift:4:11 range=[sub.swift:4:11 - line:4:11] typerepr='Dog')
(tuple_expr type='()' location=sub.swift:4:14 range=[sub.swift:4:14 - line:4:15]))
Score: 0 0 0 0 1 0 0 0 0 0 0 0 0
Type Variables:
#0 = $T0 [inout allowed] as Dog
#1 = $T1 [lvalue allowed] [inout allowed] as ()
#2 = $T2 [inout allowed]
Active Constraints:
Inactive Constraints:
Dog conv $T2 [[locator@0x7fd83d8d5c90 [Call@sub.swift:4:11]]];
Resolved overloads:
selected overload set choice Dog.Type.init: ($T1) -> $T0 == () -> Dog
($T2 bindings=(supertypes of) Dog)
Active bindings: $T2 := Dog
(trying $T2 := Dog
(found solution 0 0 0 0 1 0 0 0 0 0 0 0 0)
)
---Solution---
Fixed score: 0 0 0 0 1 0 0 0 0 0 0 0 0
Type variables:
$T1 as ()
$T0 as Dog
$T2 as Dog
Overload choices:
locator@0x7fd83d8d5d20 [Call@sub.swift:4:11 -> apply function -> constructor member] with sub.(file).Dog.init()@sub.swift:2:19 as Dog.Type.init: () -> Dog
Constraint restrictions:
Disjunction choices:
---Type-checked expression---
(call_expr type='Dog' location=sub.swift:4:11 range=[sub.swift:4:11 - line:4:15] arg_labels=
(constructor_ref_call_expr type='() -> Dog' location=sub.swift:4:11 range=[sub.swift:4:11 - line:4:11]
(declref_expr implicit type='(Dog.Type) -> () -> Dog' location=sub.swift:4:11 range=[sub.swift:4:11 - line:4:11] decl=sub.(file).Dog.init()@sub.swift:2:19 function_ref=single)
(type_expr type='Dog.Type' location=sub.swift:4:11 range=[sub.swift:4:11 - line:4:11] typerepr='Dog'))
(tuple_expr type='()' location=sub.swift:4:14 range=[sub.swift:4:14 - line:4:15]))
---Constraint solving for the expression at <invalid range>---
(increasing score due to function conversion)
(overload set choice binding ($T0) -> $T1 := () -> Animal)
---Initial constraints for the given expression---
(rebind_self_in_constructor_expr implicit type='()'
(call_expr implicit type='Animal' arg_labels=
(unresolved_dot_expr implicit type='() -> Animal' field 'init()' function_ref=single
(super_ref_expr implicit type='Animal'))
(tuple_expr implicit type='()')))
Score: 0 0 0 0 1 0 0 0 0 0 0 0 0
Type Variables:
#0 = $T0 [lvalue allowed] [inout allowed] as ()
#1 = $T1 [inout allowed] as Animal
#2 = $T2 [inout allowed] as Animal
Active Constraints:
Inactive Constraints:
Resolved overloads:
selected overload set choice Animal.Type.init: ($T0) -> $T1 == () -> Animal
(found solution 0 0 0 0 1 0 0 0 0 0 0 0 0)
---Solution---
Fixed score: 0 0 0 0 1 0 0 0 0 0 0 0 0
Type variables:
$T0 as ()
$T1 as Animal
$T2 as Animal
Overload choices:
locator@0x7fd83f0016a8 [UnresolvedDot@<invalid loc> -> constructor member] with sub.(file).Animal.init()@sub.swift:1:7 as Animal.Type.init: () -> Animal
Constraint restrictions:
Disjunction choices:
---Type-checked expression---
(rebind_self_in_constructor_expr implicit type='()'
(call_expr implicit type='Animal' arg_labels=
(dot_syntax_call_expr implicit type='() -> Animal' super
(other_constructor_ref_expr implicit type='(Animal) -> () -> Animal' decl=sub.(file).Animal.init()@sub.swift:1:7)
(super_ref_expr implicit type='Animal'))
(tuple_expr implicit type='()')))
---Constraint solving for the expression at [sub.swift:5:22 - line:5:22]---
(overload set choice binding $T0 := Dog)
---Initial constraints for the given expression---
(declref_expr type='Dog' location=sub.swift:5:22 range=[sub.swift:5:22 - line:5:22] decl=sub.(file).dog@sub.swift:4:5 direct_to_storage function_ref=unapplied)
Score: 0 0 0 0 0 0 0 0 0 0 0 0 0
Contextual Type: Animal at [sub.swift:5:13 - line:5:13]
Type Variables:
#0 = $T0 [lvalue allowed] [inout allowed] as Dog
Active Constraints:
Inactive Constraints:
Resolved overloads:
selected overload set choice dog: $T0 == Dog
(found solution 0 0 0 0 0 0 0 0 0 0 0 0 0)
---Solution---
Fixed score: 0 0 0 0 0 0 0 0 0 0 0 0 0
Type variables:
$T0 as Dog
Overload choices:
locator@0x7fd83e003400 [DeclRef@sub.swift:5:22] with sub.(file).dog@sub.swift:4:5 as dog: Dog
Constraint restrictions:
Dog to Animal is [superclass]
Disjunction choices:
---Type-checked expression---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment