Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 27 for atPos (0.09 sec)

  1. src/cmd/compile/internal/types2/typeset.go

    				check.later(func() {
    					if pos.IsKnown() && !check.allowVersion(atPos(pos), go1_14) || !Identical(m.typ, other.Type()) {
    						err := check.newError(DuplicateDecl)
    						err.addf(atPos(pos), "duplicate method %s", m.name)
    						err.addf(atPos(mpos[other.(*Func)]), "other declaration of method %s", m.name)
    						err.report()
    					}
    				}).describef(atPos(pos), "duplicate method check for %s", m.name)
    			}
    		}
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 13.6K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types2/errors.go

    	msg := check.sprintf(format, args...)
    	err := check.newError(UnsupportedFeature)
    	err.addf(at, "%s requires %s or later", msg, v)
    	err.report()
    }
    
    // atPos reports the left (= start) position of at.
    func atPos(at poser) syntax.Pos {
    	switch x := at.(type) {
    	case *operand:
    		if x.expr != nil {
    			return syntax.StartPos(x.expr)
    		}
    	case syntax.Node:
    		return syntax.StartPos(x)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 29 22:06:18 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  3. src/go/types/typeset.go

    				check.later(func() {
    					if pos.IsValid() && !check.allowVersion(atPos(pos), go1_14) || !Identical(m.typ, other.Type()) {
    						err := check.newError(DuplicateDecl)
    						err.addf(atPos(pos), "duplicate method %s", m.name)
    						err.addf(atPos(mpos[other.(*Func)]), "other declaration of method %s", m.name)
    						err.report()
    					}
    				}).describef(atPos(pos), "duplicate method check for %s", m.name)
    			}
    		}
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 13.7K bytes
    - Viewed (0)
  4. src/go/types/generate_test.go

    						n.Args[0] = arg
    						return false
    					}
    				}
    			}
    		}
    		return true
    	})
    }
    
    // fixAtPosCall updates calls of the form atPos(x) to x.Pos() in argument lists of (check).dump calls.
    // TODO(gri) can we avoid this and just use atPos consistently in go/types and types2?
    func fixAtPosCall(f *ast.File) {
    	ast.Inspect(f, func(n ast.Node) bool {
    		switch n := n.(type) {
    		case *ast.CallExpr:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 16.5K bytes
    - Viewed (0)
  5. src/go/types/errors.go

    	msg := check.sprintf(format, args...)
    	err := check.newError(UnsupportedFeature)
    	err.addf(at, "%s requires %s or later", msg, v)
    	err.report()
    }
    
    // atPos wraps a token.Pos to implement the positioner interface.
    type atPos token.Pos
    
    func (s atPos) Pos() token.Pos {
    	return token.Pos(s)
    }
    
    // posSpan holds a position range along with a highlighted position within that
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 29 22:06:18 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/types2/instantiate.go

    		if constraint && comparable(V, true /* spec comparability */, nil, nil) {
    			// V is comparable if we are at Go 1.20 or higher.
    			if check == nil || check.allowVersion(atPos(pos), go1_20) { // atPos needed so that go/types generate passes
    				return true
    			}
    			if cause != nil {
    				*cause = check.sprintf("%s to %s comparable requires go1.20 or later", V, verb)
    			}
    			return false
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 12.7K bytes
    - Viewed (0)
  7. src/go/types/const.go

    		// TODO(gri) We should report exactly what went wrong. At the
    		//           moment we don't have the (go/constant) API for that.
    		//           See also TODO in go/constant/value.go.
    		check.error(atPos(opPos), InvalidConstVal, "constant result is not representable")
    		return
    	}
    
    	// Typed constants must be representable in
    	// their type after each constant operation.
    	// x.typ cannot be a type parameter (type
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 7.6K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types2/const.go

    		// TODO(gri) We should report exactly what went wrong. At the
    		//           moment we don't have the (go/constant) API for that.
    		//           See also TODO in go/constant/value.go.
    		check.error(atPos(opPos), InvalidConstVal, "constant result is not representable")
    		return
    	}
    
    	// Typed constants must be representable in
    	// their type after each constant operation.
    	// x.typ cannot be a type parameter (type
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 22 19:32:17 UTC 2024
    - 7.5K bytes
    - Viewed (0)
  9. src/go/types/util.go

    func hasDots(call *ast.CallExpr) bool { return call.Ellipsis.IsValid() }
    
    // dddErrPos returns the positioner for reporting an invalid ... use in a call.
    func dddErrPos(call *ast.CallExpr) positioner { return atPos(call.Ellipsis) }
    
    // argErrPos returns positioner for reporting an invalid argument count.
    func argErrPos(call *ast.CallExpr) positioner { return inNode(call, call.Rparen) }
    
    // startPos returns the start position of node n.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  10. src/go/types/instantiate.go

    		if constraint && comparable(V, true /* spec comparability */, nil, nil) {
    			// V is comparable if we are at Go 1.20 or higher.
    			if check == nil || check.allowVersion(atPos(pos), go1_20) { // atPos needed so that go/types generate passes
    				return true
    			}
    			if cause != nil {
    				*cause = check.sprintf("%s to %s comparable requires go1.20 or later", V, verb)
    			}
    			return false
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 12.8K bytes
    - Viewed (0)
Back to top