Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 61 for generic (0.37 sec)

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

    // uninstantiated generic type.
    func ConvertibleTo(V, T Type) bool {
    	x := operand{mode: value, typ: V}
    	return x.convertibleTo(nil, T, nil) // check not needed for non-constant x
    }
    
    // Implements reports whether type V implements interface T.
    //
    // The behavior of Implements is unspecified if V is Typ[Invalid] or an uninstantiated
    // generic type.
    func Implements(V Type, T *Interface) bool {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 08 16:36:08 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types2/alias.go

    func (a *Alias) Underlying() Type { return unalias(a).Underlying() }
    
    // Origin returns the generic Alias type of which a is an instance.
    // If a is not an instance of a generic alias, Origin returns a.
    func (a *Alias) Origin() *Alias { return a.orig }
    
    // TypeParams returns the type parameters of the alias type a, or nil.
    // A generic Alias and its instances have the same type parameters.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 5K bytes
    - Viewed (0)
  3. src/cmd/cgo/internal/test/typeparam.go

    // license that can be found in the LICENSE file.
    
    package cgotest
    
    // #include <stddef.h>
    import "C"
    
    func generic[T, U any](t T, u U) {}
    
    func useGeneric() {
    	const zero C.size_t = 0
    
    	generic(zero, zero)
    	generic[C.size_t, C.size_t](0, 0)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 12:00:02 UTC 2023
    - 353 bytes
    - Viewed (0)
  4. src/cmd/compile/internal/ssa/_gen/decOps.go

    package main
    
    var decOps = []opData{}
    
    var decBlocks = []blockData{}
    
    func init() {
    	archs = append(archs, arch{
    		name:    "dec",
    		ops:     decOps,
    		blocks:  decBlocks,
    		generic: true,
    	})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 04 19:35:46 UTC 2022
    - 355 bytes
    - Viewed (0)
  5. src/cmd/compile/internal/syntax/printer_test.go

    	dup("package p; type _ [P * T | T]byte"),
    	dup("package p; type _ [P * T | <-T | T]byte"),
    
    	// generic function declarations
    	dup("package p; func _[T any]()"),
    	dup("package p; func _[A, B, C interface{m()}]()"),
    	dup("package p; func _[T any, A, B, C interface{m()}, X, Y, Z interface{~int}]()"),
    
    	// generic functions with elided interfaces in type constraints
    	dup("package p; func _[P *T]() {}"),
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jul 31 17:08:18 UTC 2023
    - 7.6K bytes
    - Viewed (0)
  6. doc/next/2-language.md

    For details see the [language spec](/ref/spec#For_statements).
    
    <!-- go.dev/issue/46477, CL 566856, CL 586955, CL 586956 -->
    Go 1.23 includes preview support for [generic type aliases](/issue/46477).
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 05 19:56:43 UTC 2024
    - 757 bytes
    - Viewed (0)
  7. src/cmd/compile/internal/ssa/lower.go

    	// Needs to be a separate phase because it must run after both
    	// lowering and a subsequent dead code elimination (because lowering
    	// rules may leave dead generic ops behind).
    	for _, b := range f.Blocks {
    		for _, v := range b.Values {
    			if !opcodeTable[v.Op].generic {
    				continue // lowered
    			}
    			switch v.Op {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 16 00:16:13 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  8. doc/next/6-stdlib/99-minor/go/types/67143.md

    The methods [Alias.Origin], [Alias.SetTypeParams], [Alias.TypeParams],
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 21:32:30 UTC 2024
    - 150 bytes
    - Viewed (0)
  9. src/cmd/compile/internal/test/pgo_devirtualize_test.go

    		//	callee: "mult.MultClosure.func1",
    		//},
    	}
    
    	testPGODevirtualize(t, dir, want, preProfFileName)
    }
    
    // Regression test for https://go.dev/issue/65615. If a target function changes
    // from non-generic to generic we can't devirtualize it (don't know the type
    // parameters), but the compiler should not crash.
    func TestLookupFuncGeneric(t *testing.T) {
    	wd, err := os.Getwd()
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 15 21:30:35 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/test/inst_test.go

    package test
    
    import (
    	"internal/testenv"
    	"os"
    	"path/filepath"
    	"regexp"
    	"testing"
    )
    
    // TestInst tests that only one instantiation of Sort is created, even though generic
    // Sort is used for multiple pointer types across two packages.
    func TestInst(t *testing.T) {
    	testenv.MustHaveGoBuild(t)
    	testenv.MustHaveGoRun(t)
    
    	// Build ptrsort.go, which uses package mysort.
    	var output []byte
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 06 18:07:35 UTC 2023
    - 1.9K bytes
    - Viewed (0)
Back to top