Source file src/internal/types/testdata/fixedbugs/issue51158.go

     1  // Copyright 2022 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package p
     6  
     7  // Type checking the following code should not cause an infinite recursion.
     8  func f[M map[K]int, K comparable](m M) {
     9          f(m)
    10  }
    11  
    12  // Equivalent code using mutual recursion.
    13  func f1[M map[K]int, K comparable](m M) {
    14          f2(m)
    15  }
    16  func f2[M map[K]int, K comparable](m M) {
    17          f1(m)
    18  }
    19  

View as plain text