Source file test/func3.go

     1  // errorcheck
     2  
     3  // Copyright 2009 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  // Verify that illegal function signatures are detected.
     8  // Does not compile.
     9  
    10  package main
    11  
    12  type t1 int
    13  type t2 int
    14  type t3 int
    15  
    16  func f1(*t2, x t3)	// ERROR "named"
    17  func f2(t1, *t2, x t3)	// ERROR "named"
    18  func f3() (x int, *string)	// ERROR "named"
    19  
    20  func f4() (t1 t1)	// legal - scope of parameter named t1 starts in body of f4.
    21  

View as plain text