@@ -180,23 +180,23 @@ func StaticCall(call *ir.CallExpr) {
180
180
// Returns nil when the concrete type could not be determined, or when there are multiple
181
181
// (different) types assigned to an interface.
182
182
func concreteType (n ir.Node ) (typ * types.Type ) {
183
- var assignements map [* ir.Name ][]valOrTyp
183
+ var assignments map [* ir.Name ][]valOrTyp
184
184
typ , isNil := concreteType1 (n , make (map [* ir.Name ]* types.Type ), func (n * ir.Name ) []valOrTyp {
185
- if assignements == nil {
186
- assignements = make (map [* ir.Name ][]valOrTyp )
185
+ if assignments == nil {
186
+ assignments = make (map [* ir.Name ][]valOrTyp )
187
187
if n .Curfn == nil {
188
188
base .Fatalf ("n.Curfn == nil: %v" , n )
189
189
}
190
190
fun := n .Curfn
191
191
for fun .ClosureParent != nil {
192
192
fun = fun .ClosureParent
193
193
}
194
- assignements = ifaceAssignments (fun )
194
+ assignments = ifaceAssignments (fun )
195
195
}
196
196
if ! n .Type ().IsInterface () {
197
- base .Fatalf ("name passed to getAssignements is not of an interface type: %v" , n .Type ())
197
+ base .Fatalf ("name passed to getAssignments is not of an interface type: %v" , n .Type ())
198
198
}
199
- return assignements [n ]
199
+ return assignments [n ]
200
200
})
201
201
if isNil && typ != nil {
202
202
base .Fatalf ("typ = %v; want = <nil>" , typ )
@@ -207,7 +207,7 @@ func concreteType(n ir.Node) (typ *types.Type) {
207
207
return typ
208
208
}
209
209
210
- func concreteType1 (n ir.Node , analyzed map [* ir.Name ]* types.Type , getAssignements func (* ir.Name ) []valOrTyp ) (out * types.Type , isNil bool ) {
210
+ func concreteType1 (n ir.Node , analyzed map [* ir.Name ]* types.Type , getAssignments func (* ir.Name ) []valOrTyp ) (out * types.Type , isNil bool ) {
211
211
for {
212
212
if ! n .Type ().IsInterface () {
213
213
return n .Type (), false
@@ -276,19 +276,19 @@ func concreteType1(n ir.Node, analyzed map[*ir.Name]*types.Type, getAssignements
276
276
// executes) will get a nil (from the map lookup above), where we could determine the type.
277
277
analyzed [name ] = nil
278
278
279
- assignements := getAssignements (name )
280
- if len (assignements ) == 0 {
279
+ assignments := getAssignments (name )
280
+ if len (assignments ) == 0 {
281
281
// Variable either declared with zero value, or only assigned
282
- // with nil (getAssignements does not return such assignements ).
282
+ // with nil (getAssignements does not return such assignments ).
283
283
return nil , true
284
284
}
285
285
286
286
var typ * types.Type
287
- for _ , v := range assignements {
287
+ for _ , v := range assignments {
288
288
t := v .typ
289
289
if v .node != nil {
290
290
var isNil bool
291
- t , isNil = concreteType1 (v .node , analyzed , getAssignements )
291
+ t , isNil = concreteType1 (v .node , analyzed , getAssignments )
292
292
if isNil {
293
293
if t != nil {
294
294
base .Fatalf ("t = %v; want = <nil>" , t )
0 commit comments