codekingpro/portable-devtools
114k
1// Copyright 2020 The Go Authors. All rights reserved.2// Use of this source code is governed by a BSD-style3// license that can be found in the LICENSE file.4 5package main6 7import "./a"8 9type R[T any] struct {10 F T11}12 13// type S = R // disallowed for now14 15type Sint = R[int]16 17// type Simp = a.Rimp // disallowed for now18 19// type SimpString Simp[string] // disallowed for now20type SimpString a.Rimp[string]21 22func main() {23 // var s S[int] // disallowed for now24 var s R[int]25 if s.F != 0 {26 panic(s.F)27 }28 var s2 Sint29 if s2.F != 0 {30 panic(s2.F)31 }32 // var s3 Simp[string] // disallowed for now33 var s3 a.Rimp[string]34 if s3.F != "" {35 panic(s3.F)36 }37 var s4 SimpString38 if s4.F != "" {39 panic(s4.F)40 }41}42 