"Fossies" - the Fresh Open Source Software Archive

Member "go/test/typeparam/mdempsky/5.go" (26 Apr 2023, 260 Bytes) of package /linux/misc/go1.20.4.src.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Go source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 // compile
    2 
    3 // Copyright 2021 The Go Authors. All rights reserved.
    4 // Use of this source code is governed by a BSD-style
    5 // license that can be found in the LICENSE file.
    6 
    7 package a
    8 
    9 type X[T any] int
   10 
   11 func (X[T]) F(T) {}
   12 
   13 func x() {
   14     X[interface{}](0).F(0)
   15 }