mirror of
https://github.com/golang/go.git
synced 2024-09-22 10:58:58 +00:00
constant conversion of int (non-ideal) constant doesn't work
R=rsc DELTA=20 (20 added, 0 deleted, 0 changed) OCL=26054 CL=26062
This commit is contained in:
parent
47ba59ddb0
commit
b2e91a9a29
19
test/bugs/bug138.go
Normal file
19
test/bugs/bug138.go
Normal file
@ -0,0 +1,19 @@
|
||||
// Copyright 2009 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.
|
||||
|
||||
// $G $D/$F.go || echo BUG should compile
|
||||
|
||||
package main
|
||||
|
||||
func main() {
|
||||
const c int = -1;
|
||||
var i int = -1;
|
||||
var xc uint = uint(c); // this does not work
|
||||
var xi uint = uint(i); // this works
|
||||
}
|
||||
|
||||
/*
|
||||
bug138.go:8: overflow converting constant to uint
|
||||
bug138.go:8: illegal combination of literals CONV 7
|
||||
*/
|
@ -154,6 +154,11 @@ bugs/bug137.go:9: break label is not defined: L2
|
||||
bugs/bug137.go:15: break label is not defined: L4
|
||||
BUG should compile
|
||||
|
||||
=========== bugs/bug138.go
|
||||
bugs/bug138.go:8: overflow converting constant to uint
|
||||
bugs/bug138.go:8: illegal combination of literals CONV 7
|
||||
BUG should compile
|
||||
|
||||
=========== fixedbugs/bug016.go
|
||||
fixedbugs/bug016.go:7: overflow converting constant to uint
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user