ROOTPLOIT
Server: LiteSpeed
System: Linux in-mum-web1878.main-hosting.eu 5.14.0-570.21.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 11 07:22:35 EDT 2025 x86_64
User: u435929562 (435929562)
PHP: 7.4.33
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/golang/1.22.0/src/go/parser/testdata/typeset.go2
// 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.

// This file contains test cases for typeset-only constraint elements.
// TODO(gri) gofmt once/if gofmt supports this notation.

package p

type (
        _[_ t] t
        _[_ ~t] t
        _[_ t|t] t
        _[_ ~t|t] t
        _[_ t|~t] t
        _[_ ~t|~t] t

        _[_ t, _, _ t|t] t
        _[_ t, _, _ ~t|t] t
        _[_ t, _, _ t|~t] t
        _[_ t, _, _ ~t|~t] t

        _[_ t.t] t
        _[_ ~t.t] t
        _[_ t.t|t.t] t
        _[_ ~t.t|t.t] t
        _[_ t.t|~t.t] t
        _[_ ~t.t|~t.t] t

        _[_ t, _, _ t.t|t.t] t
        _[_ t, _, _ ~t.t|t.t] t
        _[_ t, _, _ t.t|~t.t] t
        _[_ t, _, _ ~t.t|~t.t] t

        _[_ struct{}] t
        _[_ ~struct{}] t

        _[_ struct{}|t] t
        _[_ ~struct{}|t] t
        _[_ struct{}|~t] t
        _[_ ~struct{}|~t] t

        _[_ t|struct{}] t
        _[_ ~t|struct{}] t
        _[_ t|~struct{}] t
        _[_ ~t|~struct{}] t
)

// Single-expression type parameter lists and those that don't start
// with a (type parameter) name are considered array sizes.
// The term must be a valid expression (it could be a type incl. a
// tilde term) but the type-checker will complain.
type (
        _[t] t
        _[t|t] t

        // These are invalid and the type-checker will complain.
        _[~t] t
        _[~t|t] t
        _[t|~t] t
        _[~t|~t] t
)

type _[_ t, t] /* ERROR "missing type constraint" */ t
type _[_ ~t, t] /* ERROR "missing type constraint" */ t
type _[_ t, ~ /* ERROR "missing type parameter name" */ t] t
type _[_ ~t, ~ /* ERROR "missing type parameter name" */ t] t

type _[_ t|t, t /* ERROR "missing type parameter name" */ |t] t
type _[_ ~t|t, t /* ERROR "missing type parameter name" */ |t] t
type _[_ t|t, ~ /* ERROR "missing type parameter name" */ t|t] t
type _[_ ~t|t, ~ /* ERROR "missing type parameter name" */ t|t] t