Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 20 for mustTypecheck (0.17 sec)

  1. src/go/types/api_test.go

    	if conf == nil {
    		conf = &Config{
    			Error:    func(err error) {}, // collect all errors
    			Importer: importer.Default(),
    		}
    	}
    	return conf.Check(f.Name.Name, fset, []*ast.File{f}, info)
    }
    
    func mustTypecheck(src string, conf *Config, info *Info) *Package {
    	pkg, err := typecheck(src, conf, info)
    	if err != nil {
    		panic(err) // so we don't need to pass *testing.T
    	}
    	return pkg
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 94.2K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types2/api_test.go

    	if conf == nil {
    		conf = &Config{
    			Error:    func(err error) {}, // collect all errors
    			Importer: defaultImporter(),
    		}
    	}
    	return conf.Check(f.PkgName.Value, []*syntax.File{f}, info)
    }
    
    func mustTypecheck(src string, conf *Config, info *Info) *Package {
    	pkg, err := typecheck(src, conf, info)
    	if err != nil {
    		panic(err) // so we don't need to pass *testing.T
    	}
    	return pkg
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 93.3K bytes
    - Viewed (0)
  3. src/go/types/hilbert_test.go

    	// generate source
    	src := program(*H, *out)
    	if *out != "" {
    		os.WriteFile(*out, src, 0666)
    		return
    	}
    
    	DefPredeclaredTestFuncs() // declare assert (used by code generated by verify)
    	mustTypecheck(string(src), nil, nil)
    }
    
    func program(n int, out string) []byte {
    	var g gen
    
    	g.p(`// Code generated by: go test -run=Hilbert -H=%d -out=%q. DO NOT EDIT.
    
    // +`+`build ignore
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/types2/hilbert_test.go

    	// generate source
    	src := program(*H, *out)
    	if *out != "" {
    		os.WriteFile(*out, src, 0666)
    		return
    	}
    
    	DefPredeclaredTestFuncs() // declare assert (used by code generated by verify)
    	mustTypecheck(string(src), nil, nil)
    }
    
    func program(n int, out string) []byte {
    	var g gen
    
    	g.p(`// Code generated by: go test -run=Hilbert -H=%d -out=%q. DO NOT EDIT.
    
    // +`+`build ignore
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 13 21:00:12 UTC 2023
    - 3.4K bytes
    - Viewed (0)
  5. src/go/types/object_test.go

    // the same Func Object as the original method. See also go.dev/issue/34421.
    func TestEmbeddedMethod(t *testing.T) {
    	const src = `package p; type I interface { error }`
    	pkg := mustTypecheck(src, nil, nil)
    
    	// get original error.Error method
    	eface := Universe.Lookup("error")
    	orig, _, _ := LookupFieldOrMethod(eface.Type(), false, nil, "Error")
    	if orig == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 18 14:10:44 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/types2/object_test.go

    // the same Func Object as the original method. See also go.dev/issue/34421.
    func TestEmbeddedMethod(t *testing.T) {
    	const src = `package p; type I interface { error }`
    	pkg := mustTypecheck(src, nil, nil)
    
    	// get original error.Error method
    	eface := Universe.Lookup("error")
    	orig, _, _ := LookupFieldOrMethod(eface.Type(), false, nil, "Error")
    	if orig == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 18 14:10:44 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types2/example_test.go

    	info := types2.Info{
    		Types: make(map[syntax.Expr]types2.TypeAndValue),
    		Defs:  make(map[*syntax.Name]types2.Object),
    		Uses:  make(map[*syntax.Name]types2.Object),
    	}
    	pkg := mustTypecheck(input, nil, &info)
    
    	// Print package-level variables in initialization order.
    	fmt.Printf("InitOrder: %v\n\n", info.InitOrder)
    
    	// For each named object, print the line and
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 28 17:58:07 UTC 2023
    - 7.1K bytes
    - Viewed (0)
  8. src/go/types/methodset_test.go

    		// go.dev/issue/45639: We also don't allow this anymore.
    		// "type C interface{ f() }; func g[T C]() { type Y T; var a Y; _ = a }": {},
    	}
    
    	check := func(src string, methods []method, generic bool) {
    		pkg := mustTypecheck("package p;"+src, nil, nil)
    
    		scope := pkg.Scope()
    		if generic {
    			fn := pkg.Scope().Lookup("g").(*Func)
    			scope = fn.Scope()
    		}
    		obj := scope.Lookup("a")
    		if obj == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 08 15:27:57 UTC 2023
    - 6.7K bytes
    - Viewed (0)
  9. src/go/types/builtins_test.go

    	src := fmt.Sprintf(`package p; import "unsafe"; type _ unsafe.Pointer /* use unsafe */; func _[P ~[]byte]() { %s }`, src0)
    
    	uses := make(map[*ast.Ident]Object)
    	types := make(map[ast.Expr]TypeAndValue)
    	mustTypecheck(src, nil, &Info{Uses: uses, Types: types})
    
    	// find called function
    	n := 0
    	var fun ast.Expr
    	for x := range types {
    		if call, _ := x.(*ast.CallExpr); call != nil {
    			fun = call.Fun
    			n++
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/types2/builtins_test.go

    	src := fmt.Sprintf(`package p; import "unsafe"; type _ unsafe.Pointer /* use unsafe */; func _[P ~[]byte]() { %s }`, src0)
    
    	uses := make(map[*syntax.Name]Object)
    	types := make(map[syntax.Expr]TypeAndValue)
    	mustTypecheck(src, nil, &Info{Uses: uses, Types: types})
    
    	// find called function
    	n := 0
    	var fun syntax.Expr
    	for x := range types {
    		if call, _ := x.(*syntax.CallExpr); call != nil {
    			fun = call.Fun
    			n++
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 20 18:06:31 UTC 2024
    - 10.8K bytes
    - Viewed (0)
Back to top