@@ -455,7 +455,7 @@ Hindley-Milner type inference algorithm requires exponential time, and
455
455
the Swift type system introduces additional complications, especially
456
456
overload resolution. However, the problem size for any particular
457
457
expression is still fairly small, and the constraint solver can employ
458
- a number of tricks to improve performance. The Performance _ section
458
+ a number of tricks to improve performance. The [ Performance ] ( #Performance ) section
459
459
describes some tricks that have been implemented or are planned, and
460
460
it is expected that the solver will be extended with additional tricks
461
461
going forward.
@@ -530,7 +530,7 @@ The member name may refer to a set of overloaded declarations. In this
530
530
case, the type `` C `` is a fresh type variable (call it `` T0 `` ). A
531
531
disjunction constraint is introduced, each term of which new overload
532
532
set binds a different declaration's type to `` T0 `` , as described in
533
- the section on Overloading _ .
533
+ the section on [ Overloading ] ( #Overloading ) .
534
534
535
535
The kind of member constraint---type or value---also affects the
536
536
declaration type `` C `` . A type constraint can only refer to member
@@ -677,27 +677,28 @@ resolved overloads explicit. This application process walks the
677
677
expression tree from the leaves to the root, rewriting each expression
678
678
node based on the kind of expression:
679
679
680
- * Declaration references*
680
+ #### * Declaration references*
681
681
Declaration references are rewritten with the precise type of the
682
682
declaration as referenced. For overloaded declaration references, the
683
683
`` Overload*Expr `` node is replaced with a simple declaration
684
684
reference expression. For references to polymorphic functions or
685
685
members of generic types, a `` SpecializeExpr `` node is introduced to
686
686
provide substitutions for all of the generic parameters.
687
687
688
- * Member references*
688
+ #### * Member references*
689
689
References to members are similar to declaration
690
690
references. However, they have the added constraint that the base
691
691
expression needs to be a reference. Therefore, an rvalue of
692
692
non-reference type will be materialized to produce the necessary
693
693
reference.
694
694
695
- * Literals*
695
+ #### * Literals*
696
696
Literals are converted to the appropriate literal type, which
697
697
typically involves introducing calls to the witnesses for the
698
698
appropriate literal protocols.
699
699
700
- * Closures*
700
+ #### * Closures*
701
+
701
702
Since the closure has acquired a complete function type,
702
703
the body of the closure is type-checked with that
703
704
complete function type.
0 commit comments