Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 334 for Mystring (0.14 sec)

  1. test/fixedbugs/issue23814.go

    // Examples from the language spec section on string conversions.
    
    package main
    
    func main() {
    	// 1
    	_ = string('a')  // "a"
    	_ = string(-1)   // "\ufffd" == "\xef\xbf\xbd"
    	_ = string(0xf8) // "\u00f8" == "ø" == "\xc3\xb8"
    
    	type myString string
    	_ = myString(0x65e5) // "\u65e5" == "日" == "\xe6\x97\xa5"
    
    	// 2
    	_ = string([]byte{'h', 'e', 'l', 'l', '\xc3', '\xb8'}) // "hellø"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 15 00:06:24 UTC 2022
    - 1.9K bytes
    - Viewed (0)
  2. test/fixedbugs/issue5704.go

    	checkBytes([]byte(""), `[]byte("")`)
    	checkBytes([]byte(mystring("")), `[]byte(mystring(""))`)
    	checkBytes(mybytes(""), `mybytes("")`)
    	checkBytes(mybytes(mystring("")), `mybytes(mystring(""))`)
    
    	checkRunes([]rune(""), `[]rune("")`)
    	checkRunes([]rune(mystring("")), `[]rune(mystring(""))`)
    	checkRunes(myrunes(""), `myrunes("")`)
    	checkRunes(myrunes(mystring("")), `myrunes(mystring(""))`)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 1K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/test/testdata/ptrsort.go

    	"fmt"
    
    	"cmd/compile/internal/test/testdata/mysort"
    )
    
    type MyString struct {
    	string
    }
    
    func (a *MyString) Less(b *MyString) bool {
    	return a.string < b.string
    }
    
    func main() {
    	mysort.F()
    
    	sl1 := []*mysort.MyInt{{7}, {1}, {4}, {6}}
    	mysort.Sort(sl1)
    	fmt.Printf("%v %v %v %v\n", sl1[0], sl1[1], sl1[2], sl1[3])
    
    	sl2 := []*MyString{{"when"}, {"in"}, {"the"}, {"course"}, {"of"}}
    	mysort.Sort(sl2)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 16 19:10:58 UTC 2022
    - 633 bytes
    - Viewed (0)
  4. 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)
  5. 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)
  6. test/typeparam/issue49027.dir/a.go

    	case T:
    		return v
    	default:
    		var z T
    		return z
    	}
    }
    
    type Mystring string
    
    func (Mystring) Foo() {
    }
    
    func Conv4(v interface{Foo()}) Mystring {
    	return conv4[Mystring](v)
    }
    
    func conv4[T interface{Foo()}](v interface{Foo()}) T {
    	switch v := v.(type) {
    	case T:
    		return v
    	default:
    		var z T
    		return z
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 19 22:47:48 UTC 2021
    - 871 bytes
    - Viewed (0)
  7. 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)
  8. 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)
  9. 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)
  10. test/typeparam/issue49027.dir/main.go

    		panic("conversion failed")
    	}
    	if y != s {
    		panic(fmt.Sprintf("got %s wanted %s", y, s))
    	}
    	z := a.Conv3(s)
    	if z != s {
    		panic(fmt.Sprintf("got %s wanted %s", z, s))
    	}
    	w := a.Conv4(a.Mystring(s))
    	if w != a.Mystring(s) {
    		panic(fmt.Sprintf("got %s wanted %s", w, s))
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 24 02:14:15 UTC 2022
    - 617 bytes
    - Viewed (0)
Back to top