mirror of
https://github.com/golang/go
synced 2024-11-08 18:36:22 -07:00
2e60882fc7
Also adjust truncfltlit to make it more similar to trunccmplxlit, and make it report an error for bad Etypes. Fixes #19947 Change-Id: I6684523e989c2293b8a8e85bd2bfb9c399c5ea36 Reviewed-on: https://go-review.googlesource.com/40453 Reviewed-by: Robert Griesemer <gri@golang.org>
16 lines
564 B
Go
16 lines
564 B
Go
// errorcheck
|
|
|
|
// Copyright 2017 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.
|
|
|
|
// No double error on ideal -> float{32,64} conversion overflow
|
|
|
|
package issue19947
|
|
|
|
var _ = float32(1) * 1e200 // ERROR "constant 1e\+200 overflows float32"
|
|
var _ = float64(1) * 1e500 // ERROR "constant 1e\+500 overflows float64"
|
|
|
|
var _ = complex64(1) * 1e200 // ERROR "constant 1e\+200 overflows complex64"
|
|
var _ = complex128(1) * 1e500 // ERROR "constant 1e\+500 overflows complex128"
|