In lieu of the more invasive https://go-review.googlesource.com/#/c/12373/ .
Change-Id: I0221783fcaa8af04520c80cd2993d7d542d2c431
Reviewed-on: https://go-review.googlesource.com/12486
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
pkg go/types, type TypeAndValue struct, Value constant.Value
pkg go/types, type TypeName struct
pkg go/types, type Var struct
-pkg go/types, var Typ [26]*Basic
+pkg go/types, var Typ []*Basic
pkg go/types, var Universe *Scope
-pkg go/types, var UniverseByte *Basic
-pkg go/types, var UniverseRune *Basic
pkg go/types, var Unsafe *Package
pkg html/template, method (*Template) Option(...string) *Template
pkg image, const YCbCrSubsampleRatio410 = 5
// spec: "As a special case, append also accepts a first argument assignable
// to type []byte with a second argument of string type followed by ... .
// This form appends the bytes of the string.
- if nargs == 2 && call.Ellipsis.IsValid() && x.assignableTo(check.conf, NewSlice(UniverseByte)) {
+ if nargs == 2 && call.Ellipsis.IsValid() && x.assignableTo(check.conf, NewSlice(universeByte)) {
arg(x, 1)
if x.mode == invalid {
return
switch t := y.typ.Underlying().(type) {
case *Basic:
if isString(y.typ) {
- src = UniverseByte
+ src = universeByte
}
case *Slice:
src = t.elem
// (not a constant) even if the string and the
// index are constant
x.mode = value
- x.typ = UniverseByte // use 'byte' name
+ x.typ = universeByte // use 'byte' name
}
case *Array:
case UntypedInt:
return Typ[Int]
case UntypedRune:
- return UniverseRune // use 'rune' name
+ return universeRune // use 'rune' name
case UntypedFloat:
return Typ[Float64]
case UntypedComplex:
case *Basic:
if isString(typ) {
key = Typ[Int]
- val = UniverseRune // use 'rune' name
+ val = universeRune // use 'rune' name
}
case *Array:
key = Typ[Int]
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// This file implements the universe and unsafe package scopes.
+// This file sets up the universe scope and the unsafe package.
package types
Universe *Scope
Unsafe *Package
universeIota *Const
- UniverseByte *Basic // uint8 alias, but has name "byte"
- UniverseRune *Basic // int32 alias, but has name "rune"
+ universeByte *Basic // uint8 alias, but has name "byte"
+ universeRune *Basic // int32 alias, but has name "rune"
)
-var Typ = [...]*Basic{
+var Typ = []*Basic{
Invalid: {Invalid, 0, "invalid type"},
Bool: {Bool, IsBoolean, "bool"},
defPredeclaredFuncs()
universeIota = Universe.Lookup("iota").(*Const)
- UniverseByte = Universe.Lookup("byte").(*TypeName).typ.(*Basic)
- UniverseRune = Universe.Lookup("rune").(*TypeName).typ.(*Basic)
+ universeByte = Universe.Lookup("byte").(*TypeName).typ.(*Basic)
+ universeRune = Universe.Lookup("rune").(*TypeName).typ.(*Basic)
}
// Objects with names containing blanks are internal and not entered into