Files
moxa/_test/const14.go
Marc Vertes 39430c34bb fix: untyped constant converson to default type (#729)
* 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
2020-07-01 14:39:47 +02:00

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