Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 37 for FuncType (0.21 sec)

  1. src/go/types/api.go

    	// The Scopes mapping does not contain an entry for the
    	// function body ([*ast.BlockStmt]); the function's scope is
    	// associated with the [*ast.FuncType].
    	//
    	// The following node types may appear in Scopes:
    	//
    	//     *ast.File
    	//     *ast.FuncType
    	//     *ast.TypeSpec
    	//     *ast.BlockStmt
    	//     *ast.IfStmt
    	//     *ast.SwitchStmt
    	//     *ast.TypeSwitchStmt
    	//     *ast.CaseClause
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 19:57:43 UTC 2024
    - 17.2K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types2/api.go

    	// The Scopes mapping does not contain an entry for the
    	// function body ([*ast.BlockStmt]); the function's scope is
    	// associated with the [*ast.FuncType].
    	//
    	// The following node types may appear in Scopes:
    	//
    	//     *syntax.File
    	//     *syntax.FuncType
    	//     *syntax.TypeDecl
    	//     *syntax.BlockStmt
    	//     *syntax.IfStmt
    	//     *syntax.SwitchStmt
    	//     *syntax.CaseClause
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 13:48:53 UTC 2024
    - 17.4K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/syntax/printer.go

    				p.printFieldList(n.FieldList, n.TagList, _Semi)
    				p.print(outdent, newline)
    			} else {
    				p.printFieldList(n.FieldList, n.TagList, _Semi)
    			}
    		}
    		p.print(_Rbrace)
    
    	case *FuncType:
    		p.print(_Func)
    		p.printSignature(n)
    
    	case *InterfaceType:
    		p.print(_Interface)
    		if p.linebreaks && len(n.MethodList) > 1 {
    			p.print(blank)
    			p.print(_Lbrace)
    			p.print(newline, indent)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 24 07:17:27 UTC 2023
    - 21.5K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/types2/typexpr.go

    			if !isValid(typ.base) {
    				return Typ[Invalid]
    			}
    			return typ
    		}
    
    		check.errorf(e0, NotAType, "%s is not a type", e0)
    		check.use(e0)
    
    	case *syntax.FuncType:
    		typ := new(Signature)
    		setDefType(def, typ)
    		check.funcType(typ, nil, nil, e)
    		return typ
    
    	case *syntax.InterfaceType:
    		typ := check.newInterface()
    		setDefType(def, typ)
    		check.interfaceType(typ, e, def)
    		return typ
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 16.6K bytes
    - Viewed (0)
  5. src/go/types/typexpr.go

    		typ.base = Typ[Invalid] // avoid nil base in invalid recursive type declaration
    		setDefType(def, typ)
    		typ.base = check.varType(e.X)
    		return typ
    
    	case *ast.FuncType:
    		typ := new(Signature)
    		setDefType(def, typ)
    		check.funcType(typ, nil, e)
    		return typ
    
    	case *ast.InterfaceType:
    		typ := check.newInterface()
    		setDefType(def, typ)
    		check.interfaceType(typ, e, def)
    		return typ
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 16.3K bytes
    - Viewed (0)
  6. src/go/parser/resolver.go

    		// Note: don't try to resolve n.Sel, as we don't support qualified
    		// resolution.
    
    	case *ast.StructType:
    		r.openScope(n.Pos())
    		defer r.closeScope()
    		r.walkFieldList(n.Fields, ast.Var)
    
    	case *ast.FuncType:
    		r.openScope(n.Pos())
    		defer r.closeScope()
    		r.walkFuncType(n)
    
    	case *ast.CompositeLit:
    		if n.Type != nil {
    			ast.Walk(r, n.Type)
    		}
    		for _, e := range n.Elts {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 02 12:56:53 UTC 2023
    - 15.8K bytes
    - Viewed (0)
  7. src/go/printer/printer_test.go

    				}
    			}
    		})
    	}
    }
    
    // TestFuncType tests that an ast.FuncType with a nil Params field
    // can be printed (per go/ast specification). Test case for issue 3870.
    func TestFuncType(t *testing.T) {
    	src := &ast.File{
    		Name: &ast.Ident{Name: "p"},
    		Decls: []ast.Decl{
    			&ast.FuncDecl{
    				Name: &ast.Ident{Name: "f"},
    				Type: &ast.FuncType{},
    			},
    		},
    	}
    
    	var buf bytes.Buffer
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 03 14:56:25 UTC 2024
    - 20.4K bytes
    - Viewed (0)
  8. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/copylock/copylock.go

    // inadvertently copy a lock, by checking whether
    // its receiver, parameters, or return values
    // are locks.
    func checkCopyLocksFunc(pass *analysis.Pass, name string, recv *ast.FieldList, typ *ast.FuncType) {
    	if recv != nil && len(recv.List) > 0 {
    		expr := recv.List[0].Type
    		if path := lockPath(pass.Pkg, pass.TypesInfo.Types[expr].Type, nil); path != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 9.9K bytes
    - Viewed (0)
  9. src/cmd/fix/typecheck.go

    	// Most of it is bottom-up, but in a few places we need
    	// to know the type of the function we are checking.
    	// The before function records that information on
    	// the curfn stack.
    	var curfn []*ast.FuncType
    
    	before := func(n any) {
    		// push function type on stack
    		switch n := n.(type) {
    		case *ast.FuncDecl:
    			curfn = append(curfn, n.Type)
    		case *ast.FuncLit:
    			curfn = append(curfn, n.Type)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 16 22:02:42 UTC 2022
    - 20.1K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/tools/internal/analysisinternal/analysis.go

    			r := TypeExpr(f, pkg, t.Results().At(i).Type())
    			if r == nil {
    				return nil
    			}
    			returns = append(returns, &ast.Field{
    				Type: r,
    			})
    		}
    		return &ast.FuncType{
    			Params: &ast.FieldList{
    				List: params,
    			},
    			Results: &ast.FieldList{
    				List: returns,
    			},
    		}
    	case interface{ Obj() *types.TypeName }: // *types.{Alias,Named,TypeParam}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 11.7K bytes
    - Viewed (0)
Back to top