Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 210 for predeclared (0.28 sec)

  1. test/fixedbugs/bug085.go

    }
    
    /*
    uetli:~/Source/go1/test/bugs gri$ 6g bug085.go
    bug085.go:6: P: undefined
    Bus error
    */
    
    /* expected scope hierarchy (outermost to innermost)
    
    universe scope (contains predeclared identifiers int, float32, int32, len, etc.)
    "solar" scope (just holds the package name P so it can be found but doesn't conflict)
    global scope (the package global scope)
    local scopes (function scopes)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Dec 13 23:11:31 UTC 2012
    - 633 bytes
    - Viewed (0)
  2. src/go/types/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 := fset.Position(id.Pos())
    			if predeclared {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 19 04:39:56 UTC 2023
    - 13.7K bytes
    - Viewed (0)
  3. test/typeparam/sliceimp.dir/a.go

    	if len(s) == 0 {
    		var zero Elem
    		return zero
    	}
    	return Reduce(s[1:], s[0], Min[Elem])
    }
    
    // Append adds values to the end of a slice, returning a new slice.
    // This is like the predeclared append function; it's an example
    // of how to write it using generics. We used to write code like
    // this before append was added to the language, but we had to write
    // a separate copy for each type.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 30 01:55:58 UTC 2021
    - 3.3K bytes
    - Viewed (0)
  4. 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)
  5. 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)
  6. src/runtime/testdata/testprogcgo/raceprof.go

    //go:build unix
    // +build unix
    
    package main
    
    // Test that we can collect a lot of colliding profiling signals from
    // an external C thread. This used to fail when built with the race
    // detector, because a call of the predeclared function copy was
    // turned into a call to runtime.slicecopy, which is not marked nosplit.
    
    /*
    #include <signal.h>
    #include <stdint.h>
    #include <pthread.h>
    #include <sched.h>
    
    struct cgoTracebackArg {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 24 18:13:14 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/noder/posmap.go

    func (m *posMap) pos(p poser) src.XPos { return m.makeXPos(p.Pos()) }
    func (m *posMap) end(p ender) src.XPos { return m.makeXPos(p.End()) }
    
    func (m *posMap) makeXPos(pos syntax.Pos) src.XPos {
    	// Predeclared objects (e.g., the result parameter for error.Error)
    	// do not have a position.
    	if !pos.IsKnown() {
    		return src.NoXPos
    	}
    
    	posBase := m.makeSrcPosBase(pos.Base())
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jan 27 03:43:35 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  8. test/cmplx.go

    // errorcheck
    
    // Copyright 2010 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // Verify that incorrect invocations of the complex predeclared function are detected.
    // Does not compile.
    
    package main
    
    type (
    	Float32    float32
    	Float64    float64
    	Complex64  complex64
    	Complex128 complex128
    )
    
    var (
    	f32 float32
    	f64 float64
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 14 21:00:20 UTC 2019
    - 1.4K bytes
    - Viewed (0)
  9. 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)
  10. 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)
Back to top