- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 22 for NewBar (0.17 sec)
-
src/cmd/compile/internal/types2/universe.go
// type error interface{ Error() string } { obj := NewTypeName(nopos, nil, "error", nil) obj.setColor(black) typ := NewNamed(obj, nil, nil) // error.Error() string recv := NewVar(nopos, nil, "", typ) res := NewVar(nopos, nil, "", Typ[String]) sig := NewSignatureType(recv, nil, nil, nil, NewTuple(res), false) err := NewFunc(nopos, nil, "Error", sig) // interface{ Error() string }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 07 20:08:23 UTC 2024 - 9.1K bytes - Viewed (0) -
src/go/types/universe.go
// type error interface{ Error() string } { obj := NewTypeName(nopos, nil, "error", nil) obj.setColor(black) typ := NewNamed(obj, nil, nil) // error.Error() string recv := NewVar(nopos, nil, "", typ) res := NewVar(nopos, nil, "", Typ[String]) sig := NewSignatureType(recv, nil, nil, nil, NewTuple(res), false) err := NewFunc(nopos, nil, "Error", sig) // interface{ Error() string }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 07 20:08:23 UTC 2024 - 9.3K bytes - Viewed (0) -
src/cmd/compile/internal/types2/check.go
if m := check.Types; m != nil { for { tv := m[x] assert(tv.Type != nil) // should have been recorded already pos := x.Pos() tv.Type = NewTuple( NewVar(pos, check.pkg, "", t0), NewVar(pos, check.pkg, "", t1), ) m[x] = tv // if x is a parenthesized expression (p.X), update p.X p, _ := x.(*syntax.ParenExpr) if p == nil { break } x = p.X
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 23.3K bytes - Viewed (0) -
src/go/internal/gcimporter/iimport.go
// completely set up all types in ImportData. r.p.later = append(r.p.later, setConstraintArgs{t: t, constraint: constraint}) case 'V': typ := r.typ() r.declare(types.NewVar(pos, r.currPkg, name, typ)) default: errorf("unexpected tag: %v", tag) } } func (r *importReader) declare(obj types.Object) { obj.Pkg().Scope().Insert(obj) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 19.2K bytes - Viewed (0) -
src/go/types/stmt.go
// declare new variable name := identName(ident) obj = NewVar(ident.Pos(), check.pkg, name, nil) check.recordDef(ident, obj) // _ variables don't count as new variables if name != "_" { vars = append(vars, obj) } } else { check.errorf(lhs, InvalidSyntaxTree, "cannot declare %s", lhs) obj = NewVar(lhs.Pos(), check.pkg, "_", nil) // dummy variable } assert(obj.typ == nil)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 30.6K bytes - Viewed (0) -
src/go/internal/gcimporter/ureader.go
methods := make([]*types.Func, iface.NumExplicitMethods()) for i := range methods { fn := iface.ExplicitMethod(i) sig := fn.Type().(*types.Signature) recv := types.NewVar(fn.Pos(), fn.Pkg(), "", named) methods[i] = types.NewFunc(fn.Pos(), fn.Pkg(), fn.Name(), types.NewSignature(recv, sig.Params(), sig.Results(), sig.Variadic())) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 16.6K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/asmdecl/asmdecl.go
} case asmArray: tu := t.Underlying().(*types.Array) elem := tu.Elem() // Calculate offset of each element array. fields := []*types.Var{ types.NewVar(token.NoPos, nil, "fake0", elem), types.NewVar(token.NoPos, nil, "fake1", elem), } offsets := arch.sizes.Offsetsof(fields) elemoff := int(offsets[1]) for i := 0; i < int(tu.Len()); i++ {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 03 02:38:00 UTC 2024 - 22.8K bytes - Viewed (0) -
src/cmd/compile/internal/types2/stmt.go
// declare new variable name := identName(ident) obj = NewVar(ident.Pos(), check.pkg, name, nil) check.recordDef(ident, obj) // _ variables don't count as new variables if name != "_" { vars = append(vars, obj) } } else { check.errorf(lhs, InvalidSyntaxTree, "cannot declare %s", lhs) obj = NewVar(lhs.Pos(), check.pkg, "_", nil) // dummy variable } assert(obj.typ == nil)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 30.7K bytes - Viewed (0) -
src/go/types/object.go
isField bool // var is struct field used bool // set if the variable was used origin *Var // if non-nil, the Var from which this one was instantiated } // NewVar returns a new variable. // The arguments set the attributes found with all Objects. func NewVar(pos token.Pos, pkg *Package, name string, typ Type) *Var { return &Var{object: object{nil, pos, pkg, name, typ, 0, colorFor(typ), nopos}} }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 07 20:08:23 UTC 2024 - 20.1K bytes - Viewed (0) -
src/cmd/compile/internal/rangefunc/rewrite.go
return x } func (r *rewriter) stateVar(pos syntax.Pos) (*types2.Var, *syntax.VarDecl) { r.stateVarCount++ name := fmt.Sprintf("#state%d", r.stateVarCount) typ := r.int.Type() obj := types2.NewVar(pos, r.pkg, name, typ) n := syntax.NewName(pos, name) setValueType(n, typ) r.info.Defs[n] = obj return obj, &syntax.VarDecl{NameList: []*syntax.Name{n}, Values: r.stateConst(abi.RF_READY)} }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:05:44 UTC 2024 - 41.6K bytes - Viewed (0)