- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 14 for IsEmptyInterface (0.67 sec)
-
src/cmd/compile/internal/types/identity.go
case TINTER: // Make sure named any type matches any unnamed empty interface // (but not a shape type, if identStrict). isUnnamedEface := func(t *Type) bool { return t.IsEmptyInterface() && t.Sym() == nil } if flags&identStrict != 0 { return t1 == AnyType && isUnnamedEface(t2) && !t2.HasShape() || t2 == AnyType && isUnnamedEface(t1) && !t1.HasShape() }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Aug 22 20:57:01 UTC 2023 - 4.6K bytes - Viewed (0) -
src/cmd/compile/internal/walk/switch.go
// This case is an interface. Build case value from input interface. // The data word will always be the same, but the itab/type changes. if t.IsEmptyInterface() { var typ ir.Node if s.srcName.Type().IsEmptyInterface() { // E->E, nothing to do, type is already correct. typ = srcItab } else { // I->E, load type out of itab typ = itabType(srcItab)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 04 17:34:01 UTC 2024 - 30.1K bytes - Viewed (0) -
src/cmd/compile/internal/reflectdata/helpers.go
src, dst := n.X.Type(), n.Type() base.AssertfAt(dst.IsInterface(), n.Pos(), "want interface type, have %L", n) if hasRType(n, n.TypeWord, "TypeWord") { return n.TypeWord } if dst.IsEmptyInterface() { return concreteRType(pos, src) // direct eface construction } if !src.IsInterface() { return ITabAddrAt(pos, src, dst) // direct iface construction } return TypePtrAt(pos, dst) // convI2I }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Sep 12 04:50:32 UTC 2023 - 7.1K bytes - Viewed (0) -
src/cmd/compile/internal/walk/convert.go
l.SetType(toType) l.SetTypecheck(n.Typecheck()) return l } if fromType.IsEmptyInterface() { base.Fatalf("OCONVIFACE can't operate on an empty interface") } // Evaluate the input interface. c := typecheck.TempAt(base.Pos, ir.CurFunc, fromType) init.Append(ir.NewAssignStmt(base.Pos, c, n.X)) if toType.IsEmptyInterface() { // Implement interface to empty interface conversion: // // var res *uint8
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Oct 09 17:28:22 UTC 2023 - 18.2K bytes - Viewed (0) -
src/cmd/compile/internal/types/type.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Apr 04 14:29:45 UTC 2024 - 49.5K bytes - Viewed (0) -
src/cmd/compile/internal/types/fmt.go
} } case TMAP: b.WriteString("map[") tconv2(b, t.Key(), 0, mode, visited) b.WriteByte(']') tconv2(b, t.Elem(), 0, mode, visited) case TINTER: if t.IsEmptyInterface() { b.WriteString("interface {}") break } b.WriteString("interface {") for i, f := range t.AllMethods() { if i != 0 { b.WriteByte(';') } b.WriteByte(' ') switch {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Sep 12 15:41:17 UTC 2023 - 15.7K bytes - Viewed (0) -
src/cmd/compile/internal/walk/compare.go
// compare against the itab address directly? var eqtype ir.Node tab := ir.NewUnaryExpr(base.Pos, ir.OITAB, l) rtyp := reflectdata.CompareRType(base.Pos, n) if l.Type().IsEmptyInterface() { tab.SetType(types.NewPtr(types.Types[types.TUINT8])) tab.SetTypecheck(1) eqtype = ir.NewBinaryExpr(base.Pos, eq, tab, rtyp) } else {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 24 21:55:14 UTC 2023 - 16.2K bytes - Viewed (0) -
src/cmd/compile/internal/walk/expr.go
n.X = walkExpr(n.X, init) // Set up interface type addresses for back end. if !n.Type().IsInterface() && !n.X.Type().IsEmptyInterface() { n.ITab = reflectdata.ITabAddrAt(base.Pos, n.Type(), n.X.Type()) } if n.X.Type().IsInterface() && n.Type().IsInterface() && !n.Type().IsEmptyInterface() { // This kind of conversion needs a runtime call. Allocate // a descriptor for that call.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 04 17:34:01 UTC 2024 - 27.6K bytes - Viewed (0) -
src/cmd/compile/internal/typecheck/subr.go
// that itabs are unique (thus an interface with a compile-time // type I has an itab with interface type I). if types.Identical(src.Underlying(), dst.Underlying()) { if src.IsEmptyInterface() { // Conversion between two empty interfaces // requires no code. return ir.OCONVNOP, "" } if (src.Sym() == nil || dst.Sym() == nil) && !src.IsInterface() {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 05 19:45:58 UTC 2023 - 20.2K bytes - Viewed (0) -
src/cmd/compile/internal/typecheck/expr.go
n.SetType(nil) return n } if Lookdot(n, t, 0) == nil { // Legitimate field or method lookup failed, try to explain the error switch { case t.IsEmptyInterface(): base.Errorf("%v undefined (type %v is interface with no methods)", n, n.X.Type()) case t.IsPtr() && t.Elem().IsInterface(): // Pointer to interface is almost always a mistake.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Apr 04 14:29:45 UTC 2024 - 23.1K bytes - Viewed (0)