mirror of
https://github.com/golang/go
synced 2024-10-14 11:53:56 +00:00
bugs related to constat types
R=r DELTA=10 (6 added, 4 deleted, 0 changed) OCL=14348 CL=14348
This commit is contained in:
parent
b59b551be7
commit
a9af184131
|
@ -36,4 +36,10 @@ func main() {
|
||||||
i = f3div2; // BUG: probably shouldn't compile
|
i = f3div2; // BUG: probably shouldn't compile
|
||||||
assert(i == c3div2, "i == c3div2 from f3div2");
|
assert(i == c3div2, "i == c3div2 from f3div2");
|
||||||
assert(i != f3div2, "i != f3div2"); // BUG: certainly shouldn't fail
|
assert(i != f3div2, "i != f3div2"); // BUG: certainly shouldn't fail
|
||||||
|
|
||||||
|
const g float64 = 1.0;
|
||||||
|
i = g; // BUG: shouldn't compile
|
||||||
|
|
||||||
|
const h float64 = 3.14;
|
||||||
|
i = h; // BUG: certainly shouldn't compile
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,10 +89,6 @@ func floats() {
|
||||||
assert(i == f0, "i == f0");
|
assert(i == f0, "i == f0");
|
||||||
i = fm1;
|
i = fm1;
|
||||||
assert(i == fm1, "i == fm1");
|
assert(i == fm1, "i == fm1");
|
||||||
i = f1;
|
|
||||||
assert(i == f1, "i == f1");
|
|
||||||
i = f1e3;
|
|
||||||
assert(i == f1e3, "i == f1e3");
|
|
||||||
|
|
||||||
// verify that all are assignable as floats
|
// verify that all are assignable as floats
|
||||||
var f float64;
|
var f float64;
|
||||||
|
|
Loading…
Reference in a new issue