()
| 117 | } |
| 118 | |
| 119 | func (t *Variable) String() string { |
| 120 | t.instanceMu.RLock() |
| 121 | defer t.instanceMu.RUnlock() |
| 122 | if t.Instance != nil { |
| 123 | return t.Instance.String() |
| 124 | } |
| 125 | return fmt.Sprintf("typeVar%d", t.ID) |
| 126 | } |
| 127 | |
| 128 | // SetInstance sets the exemplar instance of this TypeVariable, during |
| 129 | // unification. SetInstance is the equivalent of Union in the Union-Find |