Source file test/fixedbugs/issue27356.go

     1  // errorcheck
     2  
     3  // Copyright 2018 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  // Issue 27356: function parameter hiding built-in function results in compiler crash
     8  
     9  package p
    10  
    11  var a = []int{1,2,3}
    12  
    13  func _(len int) {
    14  	_ =  len(a) // ERROR "cannot call non-function|expected function"
    15  }
    16  
    17  var cap = false
    18  var _ = cap(a) // ERROR "cannot call non-function|expected function"
    19  
    20  

View as plain text