mirror of
https://github.com/golang/go
synced 2024-11-22 20:40:03 -07:00
go/types, types2: add test case for missing return
The respective issue was fixed in types2 with CL 356189; and the problem didn't exist in go/types. This CL simply adds the test case to the type checkers as well. For #49003. Change-Id: Ib50ee8bb0ad21f2916f2b79d4f77593302899a3e Reviewed-on: https://go-review.googlesource.com/c/go/+/356411 Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
This commit is contained in:
parent
640a49b8d4
commit
fa7d11a0e9
10
src/cmd/compile/internal/types2/testdata/fixedbugs/issue49003.go
vendored
Normal file
10
src/cmd/compile/internal/types2/testdata/fixedbugs/issue49003.go
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
// Copyright 2021 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package p
|
||||
|
||||
func f(s string) int {
|
||||
for range s {
|
||||
}
|
||||
} // ERROR missing return
|
10
src/go/types/testdata/fixedbugs/issue49003.go
vendored
Normal file
10
src/go/types/testdata/fixedbugs/issue49003.go
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
// Copyright 2021 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package p
|
||||
|
||||
func f(s string) int {
|
||||
for range s {
|
||||
}
|
||||
} // ERROR missing return
|
Loading…
Reference in New Issue
Block a user