Merge pull request #117 from jiedo/patch-6

单行注释中断换行错误
This commit is contained in:
无闻
2015-08-31 20:10:21 -04:00

View File

@@ -265,10 +265,8 @@ type nr number // alias type
func main() { func main() {
a := number{5.0} a := number{5.0}
b := nr{5.0} b := nr{5.0}
// var i float32 = b // compile-error: cannot use b (type nr) as type // var i float32 = b // compile-error: cannot use b (type nr) as type float32 in assignment
float32 in assignment // var i = float32(b) // compile-error: cannot convert b (type nr) to type float32
// var i = float32(b) // compile-error: cannot convert b (type nr) to
type float32
// var c number = b // compile-error: cannot use b (type nr) as type number in assignment // var c number = b // compile-error: cannot use b (type nr) as type number in assignment
// needs a conversion: // needs a conversion:
var c = number(b) var c = number(b)