* fix: untyped constant cconverson to default type In definition assign expression, the source type is propagated to the assigned value. If the source is an untyped constant, the destination type must be set to the default type of the constant definition. A fixType function is provided to perform this. In addition, the type conversion and check of constants is refactored for simplifications. Fixes #727. * test: fix _test/const14.go
14 lines
141 B
Go
14 lines
141 B
Go
package main
|
|
|
|
import "compress/flate"
|
|
|
|
func f1(i int) { println("i:", i) }
|
|
|
|
func main() {
|
|
i := flate.BestSpeed
|
|
f1(i)
|
|
}
|
|
|
|
// Output:
|
|
// i: 1
|