mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: add typMap
Also, add two uses of Key and Val that I missed earlier. As before, direct writes to Down and Type remain in bimport. Change-Id: I487aa975926b30092db1ad74ace17994697117c1 Reviewed-on: https://go-review.googlesource.com/21330 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
dc5a7682f0
commit
76e72691a0
3 changed files with 18 additions and 13 deletions
|
|
@ -382,27 +382,24 @@ func maptype(key *Type, val *Type) *Type {
|
|||
Yyerror("invalid map key type %v", key)
|
||||
}
|
||||
|
||||
// will be resolved later.
|
||||
case TANY:
|
||||
// will be resolved later.
|
||||
break
|
||||
|
||||
// map[key] used during definition of key.
|
||||
// postpone check until key is fully defined.
|
||||
// if there are multiple uses of map[key]
|
||||
// before key is fully defined, the error
|
||||
// will only be printed for the first one.
|
||||
// good enough.
|
||||
case TFORW:
|
||||
// map[key] used during definition of key.
|
||||
// postpone check until key is fully defined.
|
||||
// if there are multiple uses of map[key]
|
||||
// before key is fully defined, the error
|
||||
// will only be printed for the first one.
|
||||
// good enough.
|
||||
if key.Maplineno == 0 {
|
||||
key.Maplineno = lineno
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
t := typ(TMAP)
|
||||
t.Down = key
|
||||
t.Type = val
|
||||
return t
|
||||
return typMap(key, val)
|
||||
}
|
||||
|
||||
// methcmp sorts by symbol, then by package path for unexported symbols.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue