Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 286 for Mystring (0.17 sec)

  1. src/internal/types/testdata/fixedbugs/issue51386.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package p
    
    type myString string
    
    func _[P ~string | ~[]byte | ~[]rune]() {
    	_ = P("")
    	const s myString = ""
    	_ = P(s)
    }
    
    func _[P myString]() {
    	_ = P("")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 02 02:58:32 UTC 2022
    - 318 bytes
    - Viewed (0)
  2. src/internal/types/testdata/check/conversions0.go

    func string_conversions() {
    	const A = string(65)
    	assert(A == "A")
    	const E = string(-1)
    	assert(E == "\uFFFD")
    	assert(E == string(1234567890))
    
    	type myint int
    	assert(A == string(myint(65)))
    
    	type mystring string
    	const _ mystring = mystring("foo")
    
    	const _ = string(true /* ERROR "cannot convert" */ )
    	const _ = string(1.2 /* ERROR "cannot convert" */ )
    	const _ = string(nil /* ERROR "cannot convert" */ )
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 02 02:58:32 UTC 2022
    - 1.7K bytes
    - Viewed (0)
  3. src/internal/types/testdata/examples/functions.go

    func g3[T any](*T, ...T) {}
    
    func _() {
    	type intSlice []int
    	g1([]int{})
    	g1(intSlice{})
    	g2(nil, 0)
    
    	type myString string
    	var s1 string
    	g3(nil, "1", myString("2"), "3")
    	g3(& /* ERROR "cannot use &s1 (value of type *string) as *myString value in argument to g3" */ s1, "1", myString("2"), "3")
    	_ = s1
    
    	type myStruct struct{x int}
    	var s2 myStruct
    	g3(nil, struct{x int}{}, myStruct{})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 30 20:19:38 UTC 2023
    - 5.5K bytes
    - Viewed (0)
  4. analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/types/KtType.kt

         *
         * ```
         * typealias MyString = String
         * typealias MyList<A> = List<A>
         *
         * val list: MyList<MyString> = listOf()
         * ```
         *
         * `MyList<MyString>` may be expanded to a type `List<String>` with an abbreviated type `MyList<String>`, where `String` also has the
         * abbreviated type `MyString`. The abbreviated type is not `MyList<MyString>`, although it might be rendered as such.
         *
         *
    Registered: Wed Jun 12 09:53:16 UTC 2024
    - Last Modified: Mon Jun 10 20:18:28 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  5. src/internal/types/testdata/spec/range.go

    		_, _ = mi, ms
    	}
    	for mi, ms := range f8 {
    		i, s = mi /* ERROR "cannot use mi (variable of type MyInt) as int value in assignment" */, ms /* ERROR "cannot use ms (variable of type MyString) as string value in assignment" */
    	}
    	for mi, ms = range f8 {
    		_, _ = mi, ms
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jan 26 04:31:42 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  6. src/reflect/type_test.go

    	"testing"
    )
    
    func TestTypeFor(t *testing.T) {
    	type (
    		mystring string
    		myiface  interface{}
    	)
    
    	testcases := []struct {
    		wantFrom any
    		got      reflect.Type
    	}{
    		{new(int), reflect.TypeFor[int]()},
    		{new(int64), reflect.TypeFor[int64]()},
    		{new(string), reflect.TypeFor[string]()},
    		{new(mystring), reflect.TypeFor[mystring]()},
    		{new(any), reflect.TypeFor[any]()},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 23:39:44 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  7. src/runtime/testdata/testprog/panicprint.go

    type MyInt32 int32
    type MyInt64 int64
    type MyString string
    type MyUint uint
    type MyUint8 uint8
    type MyUint16 uint16
    type MyUint32 uint32
    type MyUint64 uint64
    type MyUintptr uintptr
    
    func panicCustomComplex64() {
    	panic(MyComplex64(0.11 + 3i))
    }
    
    func panicCustomComplex128() {
    	panic(MyComplex128(32.1 + 10i))
    }
    
    func panicCustomString() {
    	panic(MyString("Panic\nline two"))
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 19:10:41 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  8. src/internal/types/testdata/check/expr1.go

    	z = z /* ERRORx `operand z .* must be integer` */ >> y
    }
    
    type mystring string
    
    func _(x, y string, z mystring) {
    	x = x + "foo"
    	x = x /* ERROR "not defined" */ - "foo"
    	x = x /* ERROR "mismatched types string and untyped int" */ + 1
    	x = x + y
    	x = x /* ERROR "not defined" */ - y
    	x = x /* ERROR "mismatched types string and untyped int" */* 10
    }
    
    func f() (a, b int) { return }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:54:27 UTC 2023
    - 2.7K bytes
    - Viewed (0)
  9. src/internal/types/testdata/spec/conversions.go

    }
    
    // "x is an integer or a slice of bytes or runes and T is a string type"
    
    type myInt int
    type myString string
    
    func _[T ~string](x int) T      { return T(x) }
    func _[T ~string](x myInt) T    { return T(x) }
    func _[X Integer](x X) string   { return string(x) }
    func _[X Integer](x X) myString { return myString(x) }
    func _[X Integer](x X) *string {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:54:27 UTC 2023
    - 7.4K bytes
    - Viewed (0)
  10. src/runtime/panic_test.go

    // when the underlying kind is directly printable.
    // Issue: https://golang.org/issues/37531
    func TestPanicWithDirectlyPrintableCustomTypes(t *testing.T) {
    	tests := []struct {
    		name            string
    		wantPanicPrefix string
    	}{
    		{"panicCustomBool", `panic: main.MyBool(true)`},
    		{"panicCustomComplex128", `panic: main.MyComplex128(+3.210000e+001+1.000000e+001i)`},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 19:10:41 UTC 2024
    - 1.7K bytes
    - Viewed (0)
Back to top