Search Options

Results per page
Sort
Preferred Languages
Advance

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

  1. 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)
  2. 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)
  3. 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)
  4. src/go/types/basic.go

    // license that can be found in the LICENSE file.
    
    package types
    
    // BasicKind describes the kind of basic type.
    type BasicKind int
    
    const (
    	Invalid BasicKind = iota // type is invalid
    
    	// predeclared types
    	Bool
    	Int
    	Int8
    	Int16
    	Int32
    	Int64
    	Uint
    	Uint8
    	Uint16
    	Uint32
    	Uint64
    	Uintptr
    	Float32
    	Float64
    	Complex64
    	Complex128
    	String
    	UnsafePointer
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/types2/return.go

    		*syntax.AssignStmt, *syntax.CallStmt:
    		// no chance
    
    	case *syntax.LabeledStmt:
    		return check.isTerminating(s.Stmt, s.Label.Value)
    
    	case *syntax.ExprStmt:
    		// calling the predeclared (possibly parenthesized) panic() function is terminating
    		if call, ok := syntax.Unparen(s.X).(*syntax.CallExpr); ok && check.isPanic[call] {
    			return true
    		}
    
    	case *syntax.ReturnStmt:
    		return true
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 22 19:32:17 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  6. src/go/types/return.go

    		*ast.RangeStmt:
    		// no chance
    
    	case *ast.LabeledStmt:
    		return check.isTerminating(s.Stmt, s.Label.Name)
    
    	case *ast.ExprStmt:
    		// calling the predeclared (possibly parenthesized) panic() function is terminating
    		if call, ok := ast.Unparen(s.X).(*ast.CallExpr); ok && check.isPanic[call] {
    			return true
    		}
    
    	case *ast.ReturnStmt:
    		return true
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 22 19:32:17 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  7. src/go/ast/scope.go

    			return d.Label.Pos()
    		}
    	case *AssignStmt:
    		for _, x := range d.Lhs {
    			if ident, isIdent := x.(*Ident); isIdent && ident.Name == name {
    				return ident.Pos()
    			}
    		}
    	case *Scope:
    		// predeclared object - nothing to do for now
    	}
    	return token.NoPos
    }
    
    // ObjKind describes what an [Object] represents.
    type ObjKind int
    
    // The list of possible [Object] kinds.
    const (
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 4.6K 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/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)
  10. src/internal/types/testdata/spec/assignability.go

    ](X0 TP0, X1 TP1, X2 TP2) {
    	i = X0
    	I = X0
    	c = X1
    	C = X1 // ERRORx `cannot use X1 .* as Chan value`
    	c = X2 // ERRORx `.* cannot assign chan byte \(in TP2\) to (chan int|_Chan.*)`
    }
    
    // "x is the predeclared identifier nil and T is a pointer, function, slice, map, channel, or interface type"
    func _[TP Interface](X TP) {
    	b = nil // ERROR "cannot use nil"
    	a = nil // ERROR "cannot use nil"
    	l = nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 09 17:24:42 UTC 2023
    - 5.1K bytes
    - Viewed (0)
Back to top