mirror of
https://github.com/golang/go.git
synced 2025-05-07 08:32:59 +00:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
7dff7439dc | ||
|
62c3a6350b | ||
|
eba9e08766 | ||
|
f3bdcda88a | ||
|
362f22d2d2 |
@ -1 +1,2 @@
|
|||||||
branch: master
|
branch: release-branch.go1.23
|
||||||
|
parent-branch: master
|
||||||
|
@ -543,7 +543,7 @@ func (pw *pkgWriter) typIdx(typ types2.Type, dict *writerDict) typeInfo {
|
|||||||
|
|
||||||
case *types2.Alias:
|
case *types2.Alias:
|
||||||
w.Code(pkgbits.TypeNamed)
|
w.Code(pkgbits.TypeNamed)
|
||||||
w.namedType(typ.Obj(), nil)
|
w.namedType(splitAlias(typ))
|
||||||
|
|
||||||
case *types2.TypeParam:
|
case *types2.TypeParam:
|
||||||
w.derived = true
|
w.derived = true
|
||||||
@ -2958,6 +2958,9 @@ func objTypeParams(obj types2.Object) *types2.TypeParamList {
|
|||||||
if !obj.IsAlias() {
|
if !obj.IsAlias() {
|
||||||
return obj.Type().(*types2.Named).TypeParams()
|
return obj.Type().(*types2.Named).TypeParams()
|
||||||
}
|
}
|
||||||
|
if alias, ok := obj.Type().(*types2.Alias); ok {
|
||||||
|
return alias.TypeParams()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -2974,6 +2977,14 @@ func splitNamed(typ *types2.Named) (*types2.TypeName, *types2.TypeList) {
|
|||||||
return typ.Obj(), typ.TypeArgs()
|
return typ.Obj(), typ.TypeArgs()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// splitAlias is like splitNamed, but for an alias type.
|
||||||
|
func splitAlias(typ *types2.Alias) (*types2.TypeName, *types2.TypeList) {
|
||||||
|
orig := typ.Origin()
|
||||||
|
base.Assertf(typ.Obj() == orig.Obj(), "alias type %v has object %v, but %v has object %v", typ, typ.Obj(), orig, orig.Obj())
|
||||||
|
|
||||||
|
return typ.Obj(), typ.TypeArgs()
|
||||||
|
}
|
||||||
|
|
||||||
func asPragmaFlag(p syntax.Pragma) ir.PragmaFlag {
|
func asPragmaFlag(p syntax.Pragma) ir.PragmaFlag {
|
||||||
if p == nil {
|
if p == nil {
|
||||||
return 0
|
return 0
|
||||||
|
@ -36,7 +36,7 @@ var All = []Info{
|
|||||||
{Name: "http2server", Package: "net/http"},
|
{Name: "http2server", Package: "net/http"},
|
||||||
{Name: "httplaxcontentlength", Package: "net/http", Changed: 22, Old: "1"},
|
{Name: "httplaxcontentlength", Package: "net/http", Changed: 22, Old: "1"},
|
||||||
{Name: "httpmuxgo121", Package: "net/http", Changed: 22, Old: "1"},
|
{Name: "httpmuxgo121", Package: "net/http", Changed: 22, Old: "1"},
|
||||||
{Name: "httpservecontentkeepheaders", Package: "net/http", Changed: 23, Old: "0"},
|
{Name: "httpservecontentkeepheaders", Package: "net/http", Changed: 23, Old: "1"},
|
||||||
{Name: "installgoroot", Package: "go/build"},
|
{Name: "installgoroot", Package: "go/build"},
|
||||||
{Name: "jstmpllitinterp", Package: "html/template", Opaque: true}, // bug #66217: remove Opaque
|
{Name: "jstmpllitinterp", Package: "html/template", Opaque: true}, // bug #66217: remove Opaque
|
||||||
//{Name: "multipartfiles", Package: "mime/multipart"},
|
//{Name: "multipartfiles", Package: "mime/multipart"},
|
||||||
|
@ -6,15 +6,15 @@ package unix
|
|||||||
|
|
||||||
import "syscall"
|
import "syscall"
|
||||||
|
|
||||||
const unlinkatTrap uintptr = syscall.SYS_UNLINKAT
|
|
||||||
const openatTrap uintptr = syscall.SYS_OPENAT
|
|
||||||
const fstatatTrap uintptr = syscall.SYS_FSTATAT
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
unlinkatTrap uintptr = syscall.SYS_UNLINKAT
|
||||||
|
openatTrap uintptr = syscall.SYS_OPENAT
|
||||||
|
fstatatTrap uintptr = syscall.SYS_FSTATAT
|
||||||
|
|
||||||
AT_EACCESS = 0x4
|
AT_EACCESS = 0x4
|
||||||
AT_FDCWD = 0xfffafdcd
|
AT_FDCWD = 0xfffafdcd
|
||||||
AT_REMOVEDIR = 0x2
|
AT_REMOVEDIR = 0x2
|
||||||
AT_SYMLINK_NOFOLLOW = 0x1
|
AT_SYMLINK_NOFOLLOW = 0x1
|
||||||
|
|
||||||
UTIME_OMIT = -0x1
|
UTIME_OMIT = -0x2
|
||||||
)
|
)
|
||||||
|
23
test/fixedbugs/issue68054.go
Normal file
23
test/fixedbugs/issue68054.go
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
// compile -goexperiment aliastypeparams
|
||||||
|
|
||||||
|
// Copyright 2024 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package p
|
||||||
|
|
||||||
|
type Seq[V any] = func(yield func(V) bool)
|
||||||
|
|
||||||
|
func f[E any](seq Seq[E]) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func g() {
|
||||||
|
f(Seq[int](nil))
|
||||||
|
}
|
||||||
|
|
||||||
|
type T[P any] struct{}
|
||||||
|
|
||||||
|
type A[P any] = T[P]
|
||||||
|
|
||||||
|
var _ A[int]
|
Loading…
x
Reference in New Issue
Block a user