Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for newChecker (0.16 sec)

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

    type actionDesc struct {
    	pos    poser
    	format string
    	args   []interface{}
    }
    
    // A Checker maintains the state of the type checker.
    // It must be created with NewChecker.
    type Checker struct {
    	// package information
    	// (initialized by NewChecker, valid for the life-time of checker)
    	conf *Config
    	ctxt *Context // context for de-duplicating instances
    	pkg  *Package
    	*Info
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 23.3K bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/directive/directive.go

    	if err != nil {
    		return err
    	}
    
    	check := newChecker(pass, filename, nil)
    	check.nonGoFile(token.Pos(tf.Base()), string(content))
    	return nil
    }
    
    type checker struct {
    	pass     *analysis.Pass
    	filename string
    	file     *ast.File // nil for non-Go file
    	inHeader bool      // in file header (before or adjoining package declaration)
    }
    
    func newChecker(pass *analysis.Pass, filename string, file *ast.File) *checker {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  3. src/go/types/check.go

    type actionDesc struct {
    	pos    positioner
    	format string
    	args   []any
    }
    
    // A Checker maintains the state of the type checker.
    // It must be created with [NewChecker].
    type Checker struct {
    	// package information
    	// (initialized by NewChecker, valid for the life-time of checker)
    	conf *Config
    	ctxt *Context // context for de-duplicating instances
    	fset *token.FileSet
    	pkg  *Package
    	*Info
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  4. src/go/types/eval.go

    			}
    			// s == nil || s == pkg.scope
    			if s == nil {
    				return fmt.Errorf("no position %s found in package %s", fset.Position(pos), pkg.name)
    			}
    		}
    	}
    
    	// initialize checker
    	check := NewChecker(nil, fset, pkg, info)
    	check.scope = scope
    	check.pos = pos
    	defer check.handleBailout(&err)
    
    	// evaluate node
    	var x operand
    	check.rawExpr(nil, &x, expr, nil, true) // allow generic expressions
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:03 UTC 2023
    - 3.1K bytes
    - Viewed (0)
  5. src/go/types/named_test.go

    	*Tree[T]
    }
    
    func (Node[Q]) M(Q) {}
    
    type Inst = *Tree[int]
    `
    
    	fset := token.NewFileSet()
    	f := mustParse(fset, src)
    	pkg := NewPackage("p", f.Name.Name)
    	if err := NewChecker(nil, fset, pkg, nil).Files([]*ast.File{f}); err != nil {
    		t.Fatal(err)
    	}
    
    	firstFieldType := func(n *Named) *Named {
    		return n.Underlying().(*Struct).Field(0).Type().(*Pointer).Elem().(*Named)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 05 16:29:58 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/types2/named_test.go

    type Node[T any] struct {
    	*Tree[T]
    }
    
    func (Node[Q]) M(Q) {}
    
    type Inst = *Tree[int]
    `
    
    	f := mustParse(src)
    	pkg := NewPackage("p", f.PkgName.Value)
    	if err := NewChecker(nil, pkg, nil).Files([]*syntax.File{f}); err != nil {
    		t.Fatal(err)
    	}
    
    	firstFieldType := func(n *Named) *Named {
    		return n.Underlying().(*Struct).Field(0).Type().(*Pointer).Elem().(*Named)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 16 21:06:56 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types2/api.go

    // Package types2 declares the data types and implements
    // the algorithms for type-checking of Go packages. Use
    // Config.Check to invoke the type checker for a package.
    // Alternatively, create a new type checker with NewChecker
    // and invoke it incrementally by calling Checker.Files.
    //
    // Type-checking consists of several interdependent phases:
    //
    // Name resolution maps each identifier (syntax.Name) in the program to the
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 13:48:53 UTC 2024
    - 17.4K bytes
    - Viewed (0)
  8. src/go/types/api.go

    // Package types declares the data types and implements
    // the algorithms for type-checking of Go packages. Use
    // [Config.Check] to invoke the type checker for a package.
    // Alternatively, create a new type checker with [NewChecker]
    // and invoke it incrementally by calling [Checker.Files].
    //
    // Type-checking consists of several interdependent phases:
    //
    // Name resolution maps each identifier ([ast.Ident]) in the program
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 19:57:43 UTC 2024
    - 17.2K bytes
    - Viewed (0)
  9. src/go/types/methodset_test.go

    type Instance = *Tree[int]
    `
    
    	fset := token.NewFileSet()
    	f, err := parser.ParseFile(fset, "foo.go", src, 0)
    	if err != nil {
    		panic(err)
    	}
    	pkg := NewPackage("pkg", f.Name.Name)
    	if err := NewChecker(nil, fset, pkg, nil).Files([]*ast.File{f}); err != nil {
    		panic(err)
    	}
    
    	T := pkg.Scope().Lookup("Instance").Type()
    	_ = NewMethodSet(T) // verify that NewMethodSet terminates
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 08 15:27:57 UTC 2023
    - 6.7K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/types2/issues_test.go

    	var conf Config
    	info := &Info{Defs: make(map[*syntax.Name]Object)}
    	check := NewChecker(&conf, NewPackage("", "p"), info)
    	if err := check.Files([]*syntax.File{f1, f2}); err != nil {
    		t.Fatal(err)
    	}
    	want := printInfo(info)
    
    	// type-check incrementally
    	info = &Info{Defs: make(map[*syntax.Name]Object)}
    	check = NewChecker(&conf, NewPackage("", "p"), info)
    	if err := check.Files([]*syntax.File{f1}); err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 28.1K bytes
    - Viewed (0)
Back to top