Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 56 for predeclared (0.42 sec)

  1. src/go/doc/reader.go

    func (r *reader) cleanupTypes() {
    	for _, t := range r.types {
    		visible := r.isVisible(t.name)
    		predeclared := predeclaredTypes[t.name]
    
    		if t.decl == nil && (predeclared || visible && (t.isEmbedded || r.hasDotImp)) {
    			// t.name is a predeclared type (and was not redeclared in this package),
    			// or it was embedded somewhere but its declaration is missing (because
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 27.5K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types2/stdlib_test.go

    	// All Objects have a package, except predeclared ones.
    	errorError := Universe.Lookup("error").Type().Underlying().(*Interface).ExplicitMethod(0) // (error).Error
    	for id, obj := range info.Uses {
    		predeclared := obj == Universe.Lookup(obj.Name()) || obj == errorError
    		if predeclared == (obj.Pkg() != nil) {
    			posn := id.Pos()
    			if predeclared {
    				return nil, fmt.Errorf("%s: predeclared object with package: %s", posn, obj)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:18:33 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  3. src/go/internal/gcimporter/support.go

    		return types.RecvOnly
    	case 2 /* Csend */ :
    		return types.SendOnly
    	case 3 /* Cboth */ :
    		return types.SendRecv
    	default:
    		errorf("unexpected channel dir %d", d)
    		return 0
    	}
    }
    
    var predeclared = []types.Type{
    	// basic types
    	types.Typ[types.Bool],
    	types.Typ[types.Int],
    	types.Typ[types.Int8],
    	types.Typ[types.Int16],
    	types.Typ[types.Int32],
    	types.Typ[types.Int64],
    	types.Typ[types.Uint],
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/types2/universe.go

    // license that can be found in the LICENSE file.
    
    // This file sets up the universe scope and the unsafe package.
    
    package types2
    
    import (
    	"go/constant"
    	"strings"
    )
    
    // The Universe scope contains all predeclared objects of Go.
    // It is the outermost scope of any chain of nested scopes.
    var Universe *Scope
    
    // The Unsafe package is the package returned by an importer
    // for the import path "unsafe".
    var Unsafe *Package
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  5. src/go/types/universe.go

    // license that can be found in the LICENSE file.
    
    // This file sets up the universe scope and the unsafe package.
    
    package types
    
    import (
    	"go/constant"
    	"strings"
    )
    
    // The Universe scope contains all predeclared objects of Go.
    // It is the outermost scope of any chain of nested scopes.
    var Universe *Scope
    
    // The Unsafe package is the package returned by an importer
    // for the import path "unsafe".
    var Unsafe *Package
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/types2/typestring.go

    				w.string(subscript(t.id))
    			}
    			// If the type parameter name is the same as a predeclared object
    			// (say int), point out where it is declared to avoid confusing
    			// error messages. This doesn't need to be super-elegant; we just
    			// need a clear indication that this is not a predeclared name.
    			if w.ctxt == nil && Universe.Lookup(t.obj.name) != nil {
    				if isTypes2 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 12.2K bytes
    - Viewed (0)
  7. src/go/internal/gcimporter/iimport.go

    		},
    	}
    	defer p.fake.setLines() // set lines for files in fset
    
    	for i, pt := range predeclared {
    		p.typCache[uint64(i)] = pt
    	}
    	// Special handling for "any", whose representation may be changed by the
    	// gotypesalias GODEBUG variable.
    	p.typCache[uint64(len(predeclared))] = types.Universe.Lookup("any").Type()
    
    	pkgList := make([]*types.Package, r.uint64())
    	for i := range pkgList {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 19.2K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types2/object_test.go

    )
    
    func TestIsAlias(t *testing.T) {
    	check := func(obj *TypeName, want bool) {
    		if got := obj.IsAlias(); got != want {
    			t.Errorf("%v: got IsAlias = %v; want %v", obj, got, want)
    		}
    	}
    
    	// predeclared types
    	check(Unsafe.Scope().Lookup("Pointer").(*TypeName), false)
    	for _, name := range Universe.Names() {
    		if obj, _ := Universe.Lookup(name).(*TypeName); obj != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 18 14:10:44 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  9. src/go/types/typestring.go

    				w.string(subscript(t.id))
    			}
    			// If the type parameter name is the same as a predeclared object
    			// (say int), point out where it is declared to avoid confusing
    			// error messages. This doesn't need to be super-elegant; we just
    			// need a clear indication that this is not a predeclared name.
    			if w.ctxt == nil && Universe.Lookup(t.obj.name) != nil {
    				if isTypes2 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 12.3K bytes
    - Viewed (0)
  10. src/go/types/object_test.go

    )
    
    func TestIsAlias(t *testing.T) {
    	check := func(obj *TypeName, want bool) {
    		if got := obj.IsAlias(); got != want {
    			t.Errorf("%v: got IsAlias = %v; want %v", obj, got, want)
    		}
    	}
    
    	// predeclared types
    	check(Unsafe.Scope().Lookup("Pointer").(*TypeName), false)
    	for _, name := range Universe.Names() {
    		if obj, _ := Universe.Lookup(name).(*TypeName); obj != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 18 14:10:44 UTC 2024
    - 5.2K bytes
    - Viewed (0)
Back to top