Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 125 for typechecker (0.15 sec)

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

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // This file implements a typechecker test harness. The packages specified
    // in tests are typechecked. Error messages reported by the typechecker are
    // compared against the errors expected in the test files.
    //
    // Expected errors are indicated in the test files by putting comments
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 19:45:33 UTC 2024
    - 13.8K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/walk/complit.go

    		//	map[vstatk[i]] = vstate[i]
    		// }
    		i := typecheck.TempAt(base.Pos, ir.CurFunc, types.Types[types.TINT])
    		rhs := ir.NewIndexExpr(base.Pos, vstate, i)
    		rhs.SetBounded(true)
    
    		kidx := ir.NewIndexExpr(base.Pos, vstatk, i)
    		kidx.SetBounded(true)
    
    		// typechecker rewrites OINDEX to OINDEXMAP
    		lhs := typecheck.AssignExpr(ir.NewIndexExpr(base.Pos, m, kidx)).(*ir.IndexExpr)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:03:54 UTC 2023
    - 19.5K bytes
    - Viewed (0)
  3. src/go/types/errors.go

    		}
    	}
    
    	if check.conf._Trace {
    		check.trace(err.posn().Pos(), "ERROR: %s (code = %d)", err.desc[0].msg, err.code)
    	}
    
    	// In go/types, if there is a sub-error with a valid position,
    	// call the typechecker error handler for each sub-error.
    	// Otherwise, call it once, with a single combined message.
    	multiError := false
    	if !isTypes2 {
    		for i := 1; i < len(err.desc); i++ {
    			if err.desc[i].posn.Pos().IsValid() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 29 22:06:18 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/types2/errors.go

    			return
    		}
    	}
    
    	if check.conf.Trace {
    		check.trace(err.pos(), "ERROR: %s (code = %d)", err.desc[0].msg, err.code)
    	}
    
    	// In go/types, if there is a sub-error with a valid position,
    	// call the typechecker error handler for each sub-error.
    	// Otherwise, call it once, with a single combined message.
    	multiError := false
    	if !isTypes2 {
    		for i := 1; i < len(err.desc); i++ {
    			if err.desc[i].pos.IsKnown() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 29 22:06:18 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/walk/range.go

    				// v1 = hv1t
    				body = append(body, rangeAssign(nrange, hv1t))
    			}
    		}
    	}
    
    	typecheck.Stmts(init)
    
    	nfor.PtrInit().Append(init...)
    
    	typecheck.Stmts(nfor.Cond.Init())
    
    	nfor.Cond = typecheck.Expr(nfor.Cond)
    	nfor.Cond = typecheck.DefaultLit(nfor.Cond, nil)
    	nfor.Post = typecheck.Stmt(nfor.Post)
    	typecheck.Stmts(body)
    	nfor.Body.Append(body...)
    	nfor.Body.Append(nrange.Body...)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 20 14:52:33 UTC 2023
    - 17.6K bytes
    - Viewed (0)
  6. src/go/types/issues_test.go

    	const src = `
    package p
    
    func f[T any]() {}
    func _()        { f() }
    `
    	// no error handler provided (this issue)
    	var conf Config
    	typecheck(src, &conf, nil) // must not panic
    
    	// with error handler (sanity check)
    	conf.Error = func(error) {}
    	typecheck(src, &conf, nil) // must not panic
    }
    
    func TestIssue63260(t *testing.T) {
    	const src = `
    package p
    
    func _() {
            use(f[*string])
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 28.1K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/walk/switch.go

    				nif.Cond = typecheck.Expr(nif.Cond)
    				nif.Cond = typecheck.DefaultLit(nif.Cond, nil)
    				out.Append(nif)
    				out = &nif.Else
    			}
    			return
    		}
    
    		half := lo + n/2
    		nif := ir.NewIfStmt(base.Pos, nil, nil, nil)
    		nif.Cond = less(half)
    		base.Pos = base.Pos.WithNotStmt()
    		nif.Cond = typecheck.Expr(nif.Cond)
    		nif.Cond = typecheck.DefaultLit(nif.Cond, nil)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:01 UTC 2024
    - 30.1K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types2/issues_test.go

    	const src = `
    package p
    
    func f[T any]() {}
    func _()        { f() }
    `
    	// no error handler provided (this issue)
    	var conf Config
    	typecheck(src, &conf, nil) // must not panic
    
    	// with error handler (sanity check)
    	conf.Error = func(error) {}
    	typecheck(src, &conf, nil) // must not panic
    }
    
    func TestIssue63260(t *testing.T) {
    	const src = `
    package p
    
    func _() {
            use(f[*string])
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 28.1K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/types2/resolver.go

    				var obj Object
    				for _, scope := range fileScopes {
    					if scope.Contains(ident.Pos()) {
    						obj = scope.Lookup(ident.Value)
    					}
    				}
    				// If Config.go115UsesCgo is set, the typechecker will resolve Cgo
    				// selectors to their cgo name. We must do the same here.
    				if pname, _ := obj.(*PkgName); pname != nil {
    					if pname.imported.cgo { // only set if Config.go115UsesCgo is set
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 18 14:10:44 UTC 2024
    - 26.3K bytes
    - Viewed (0)
  10. src/go/types/resolver.go

    				var obj Object
    				for _, scope := range fileScopes {
    					if scope.Contains(ident.Pos()) {
    						obj = scope.Lookup(ident.Name)
    					}
    				}
    				// If Config.go115UsesCgo is set, the typechecker will resolve Cgo
    				// selectors to their cgo name. We must do the same here.
    				if pname, _ := obj.(*PkgName); pname != nil {
    					if pname.imported.cgo { // only set if Config.go115UsesCgo is set
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 16:22:59 UTC 2024
    - 26.1K bytes
    - Viewed (0)
Back to top