Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 70 for predeclared (0.27 sec)

  1. src/cmd/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go

    // function to fail if called on a package loaded from export data.
    // TODO(adonovan): is this a bug or feature? Should this package
    // compute accessibility in the same way?
    //
    // For does not return a path for predeclared names, imported package
    // names, local names, and unexported package-level names (except
    // types).
    //
    // Example: given this definition,
    //
    //	package p
    //
    //	type T interface {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/ssa/_gen/rulegen.go

    	w.List = append(w.List, node)
    }
    
    // predeclared contains globally known tokens that should not be redefined.
    var predeclared = map[string]bool{
    	"nil":   true,
    	"false": true,
    	"true":  true,
    }
    
    // declared reports if the body contains a Declare with the given name.
    func (w *BodyBase) declared(name string) bool {
    	if predeclared[name] {
    		// Treat predeclared names as having already been declared.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Sep 02 22:09:21 UTC 2023
    - 48.7K bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/tools/internal/typesinternal/errorcode.go

    	// is not a valid constant type.
    	//
    	// Example:
    	//  const c *int = 4
    	InvalidConstType
    
    	/* decls > var (+ other variable assignment codes) */
    
    	// UntypedNilUse occurs when the predeclared (untyped) value nil is used to
    	// initialize a variable declared without an explicit type.
    	//
    	// Example:
    	//  var x = nil
    	UntypedNilUse
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 02:38:00 UTC 2024
    - 34K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/types/fmt.go

    		for i, et := range tys {
    			if i > 0 {
    				b.WriteByte(',')
    			}
    			b.WriteString(et.String())
    		}
    		return
    	}
    
    	if t == AnyType || t == ByteType || t == RuneType {
    		// in %-T mode collapse predeclared aliases with their originals.
    		switch mode {
    		case fmtTypeIDName, fmtTypeID:
    			t = Types[t.Kind()]
    		default:
    			sconv2(b, t.Sym(), 'S', mode)
    			return
    		}
    	}
    	if t == ErrorType {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 15:41:17 UTC 2023
    - 15.7K bytes
    - Viewed (0)
  5. src/log/slog/value.go

    		}
    	}
    	return n
    }
    
    // AnyValue returns a [Value] for the supplied value.
    //
    // If the supplied value is of type Value, it is returned
    // unmodified.
    //
    // Given a value of one of Go's predeclared string, bool, or
    // (non-complex) numeric types, AnyValue returns a Value of kind
    // [KindString], [KindBool], [KindUint64], [KindInt64], or [KindFloat64].
    // The width of the original numeric type is not preserved.
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:12:08 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  6. src/go/types/assignments.go

    			}
    			seen[name] = true
    		}
    
    		// Use the correct obj if the ident is redeclared. The
    		// variable's scope starts after the declaration; so we
    		// must use Scope.Lookup here and call Scope.Insert
    		// (via check.declare) later.
    		if alt := scope.Lookup(name); alt != nil {
    			check.recordUse(ident, alt)
    			// redeclared object must be a variable
    			if obj, _ := alt.(*Var); obj != nil {
    				lhsVars[i] = obj
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 16.4K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types2/assignments.go

    			}
    			seen[name] = true
    		}
    
    		// Use the correct obj if the ident is redeclared. The
    		// variable's scope starts after the declaration; so we
    		// must use Scope.Lookup here and call Scope.Insert
    		// (via check.declare) later.
    		if alt := scope.Lookup(name); alt != nil {
    			check.recordUse(ident, alt)
    			// redeclared object must be a variable
    			if obj, _ := alt.(*Var); obj != nil {
    				lhsVars[i] = obj
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 23 21:21:43 UTC 2024
    - 16.4K bytes
    - Viewed (0)
  8. src/internal/types/errors/codes.go

    	// InvalidConstType occurs when the underlying type in a const declaration
    	// is not a valid constant type.
    	//
    	// Example:
    	//  const c *int = 4
    	InvalidConstType
    
    	// UntypedNilUse occurs when the predeclared (untyped) value nil is used to
    	// initialize a variable declared without an explicit type.
    	//
    	// Example:
    	//  var x = nil
    	UntypedNilUse
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 22:50:48 UTC 2024
    - 33.7K bytes
    - Viewed (0)
  9. src/internal/types/testdata/check/builtins0.go

    	f32 = imag /* ERRORx `cannot use .* in assignment` */ (c128)
    	f64 = imag /* ERRORx `cannot use .* in assignment` */ (c64)
    	imag /* ERROR "not used" */ (c64)
    	_, _ = f32, f64
    
    	// complex type may not be predeclared
    	type C64 complex64
    	type C128 complex128
    	var x64 C64
    	var x128 C128
    	f32 = imag(x64)
    	f64 = imag(x128)
    
    	var a []complex64
    	_ = imag(a... /* ERROR "invalid use of ..." */ )
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 29.3K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/types2/api.go

    	switch tv.mode {
    	case constant_, variable, mapindex, value, nilvalue, commaok, commaerr:
    		return true
    	}
    	return false
    }
    
    // IsNil reports whether the corresponding expression denotes the
    // predeclared value nil. Depending on context, it may have been
    // given a type different from UntypedNil.
    func (tv TypeAndValue) IsNil() bool {
    	return tv.mode == nilvalue
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 13:48:53 UTC 2024
    - 17.4K bytes
    - Viewed (0)
Back to top