- Sort Score
- Result 10 results
- Languages All
Results 1 - 6 of 6 for type_string (0.41 sec)
-
src/cmd/compile/internal/types2/typestring.go
return func(other *Package) string { if pkg == other { return "" // same package; unqualified } return other.Path() } } // TypeString returns the string representation of typ. // The [Qualifier] controls the printing of // package-level objects, and may be nil. func TypeString(typ Type, qf Qualifier) string { var buf bytes.Buffer WriteType(&buf, typ, qf) return buf.String() }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 03:01:18 UTC 2024 - 12.2K bytes - Viewed (0) -
src/cmd/compile/internal/types2/issues_test.go
func TestIssue44515(t *testing.T) { typ := Unsafe.Scope().Lookup("Pointer").Type() got := TypeString(typ, nil) want := "unsafe.Pointer" if got != want { t.Errorf("got %q; want %q", got, want) } qf := func(pkg *Package) string { if pkg == Unsafe { return "foo" } return "" } got = TypeString(typ, qf) want = "foo.Pointer" if got != want { t.Errorf("got %q; want %q", got, want)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 28.1K bytes - Viewed (0) -
src/cmd/compile/internal/types2/named.go
func (t *Named) Underlying() Type { // TODO(gri) Investigate if Unalias can be moved to where underlying is set. return Unalias(t.resolve().underlying) } func (t *Named) String() string { return TypeString(t, nil) } // ---------------------------------------------------------------------------- // Implementation // // TODO(rfindley): reorganize the loading and expansion methods under this // heading.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 15 20:03:31 UTC 2024 - 23.9K bytes - Viewed (0) -
src/cmd/compile/internal/types2/operand.go
if x.mode == nilvalue { switch x.typ { case nil, Typ[Invalid]: return "nil (with invalid type)" case Typ[UntypedNil]: return "nil" default: return fmt.Sprintf("nil (of type %s)", TypeString(x.typ, qf)) } } } else { // go/types if x.mode == value && x.typ == Typ[UntypedNil] { return "nil" } } var buf bytes.Buffer var expr string if x.expr != nil {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 21:17:10 UTC 2024 - 11K bytes - Viewed (0) -
src/cmd/compile/internal/types2/stmt.go
for t, other := range seen { if T == nil && t == nil || T != nil && t != nil && Identical(T, t) { // talk about "case" rather than "type" because of nil case Ts := "nil" if T != nil { Ts = TypeString(T, check.qualifier) } err := check.newError(DuplicateCase) err.addf(e, "duplicate case %s in type switch", Ts) err.addf(other, "previous case") err.report() continue L } }
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/cmd/compile/internal/types2/signature.go
// Variadic reports whether the signature s is variadic. func (s *Signature) Variadic() bool { return s.variadic } func (s *Signature) Underlying() Type { return s } func (s *Signature) String() string { return TypeString(s, nil) } // ---------------------------------------------------------------------------- // Implementation // funcType type-checks a function or method type.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 15 21:33:05 UTC 2024 - 12.6K bytes - Viewed (0)