Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for typeswitches (0.37 sec)

  1. src/internal/types/testdata/check/stmt0.go

    		var _ I = t
    	}
    }
    
    // Test correct typeswitch against interface types.
    type A interface { a() }
    type B interface { b() }
    type C interface { a(int) }
    
    func typeswitch2() {
    	switch A(nil).(type) {
    	case A:
    	case B:
    	case C /* STRICT "cannot have dynamic type" */: // only an error in strict mode (issue 8561)
    	}
    }
    
    func typeswitch3(x interface{}) {
    	switch x.(type) {
    	case int:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 19K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/walk/switch.go

    		}
    		hashField = itabHashField
    	}
    	return boundedDotPtr(pos, itab, hashField)
    }
    
    var rtypeHashField, itabHashField *types.Field
    
    // A typeSwitch walks a type switch.
    type typeSwitch struct {
    	// Temporary variables (i.e., ONAMEs) used by type switch dispatch logic:
    	srcName  ir.Node // value being type-switched on
    	hashName ir.Node // type hash of the value being type-switched on
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:01 UTC 2024
    - 30.1K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/tensorflow/utils/export_utils.cc

    #include <vector>
    
    #include "absl/container/flat_hash_set.h"
    #include "absl/memory/memory.h"
    #include "absl/strings/str_split.h"
    #include "absl/strings/string_view.h"
    #include "llvm/ADT/StringRef.h"
    #include "llvm/ADT/TypeSwitch.h"
    #include "llvm/Support/Casting.h"
    #include "mlir/Dialect/Func/IR/FuncOps.h"  // from @llvm-project
    #include "mlir/IR/Attributes.h"  // from @llvm-project
    #include "mlir/IR/BuiltinOps.h"  // from @llvm-project
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 19.7K bytes
    - Viewed (0)
  4. src/cmd/vendor/golang.org/x/tools/go/cfg/builder.go

    }
    
    func (b *builder) stmt(_s ast.Stmt) {
    	// The label of the current statement.  If non-nil, its _goto
    	// target is always set; its _break and _continue are set only
    	// within the body of switch/typeswitch/select/for/range.
    	// It is effectively an additional default-nil parameter of stmt().
    	var label *lblock
    start:
    	switch s := _s.(type) {
    	case *ast.BadStmt,
    		*ast.SendStmt,
    		*ast.IncDecStmt,
    		*ast.GoStmt,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 11.4K bytes
    - Viewed (0)
  5. src/go/printer/testdata/comments.input

    	}
    	if x < 0 {  /* the tab printed before this comment's /* must not affect the remaining lines */
    		return -x  // this statement should be properly indented
    	}
    	return x
    }
    
    
    func typeswitch(x interface{}) {
    	switch v := x.(type) {
    	case bool, int, float:
    	case string:
    	default:
    	}
    
    	switch x.(type) {
    	}
    
    	switch v0, ok := x.(int); v := x.(type) {
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 25 23:11:14 UTC 2022
    - 11.3K bytes
    - Viewed (0)
  6. src/go/printer/testdata/comments.golden

    	}
    	if x < 0 {	/* the tab printed before this comment's /* must not affect the remaining lines */
    		return -x	// this statement should be properly indented
    	}
    	return x
    }
    
    func typeswitch(x interface{}) {
    	switch v := x.(type) {
    	case bool, int, float:
    	case string:
    	default:
    	}
    
    	switch x.(type) {
    	}
    
    	switch v0, ok := x.(int); v := x.(type) {
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 25 23:11:14 UTC 2022
    - 11.3K bytes
    - Viewed (0)
  7. src/go/parser/parser_test.go

    	{name: "switch", format: "package main; func main() { «switch { default: «» }»}", scope: true, scopeMultiplier: 2},               // Scopes: TypeSwitchStmt, CaseClause
    	{name: "typeswitch", format: "package main; func main() { «switch x.(type) { default: «» }» }", scope: true, scopeMultiplier: 2}, // Scopes: TypeSwitchStmt, CaseClause
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 31 20:26:14 UTC 2024
    - 24.6K bytes
    - Viewed (0)
Back to top