neoneo-go/pkg/compiler/testdata/inline/c/null.go
Evgeniy Stratonikov ce24451fde compiler: allow to use conditional returns in inlined functions
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2022-07-12 12:43:31 +03:00

22 lines
263 B
Go

package c
func Is42(a int) bool {
if a == 42 {
return true
}
return false
}
func MulIfSmall(n int) int {
if n < 10 {
return n * 2
}
return n
}
func Transform(a, b int) int {
if Is42(a) && !Is42(b) {
return MulIfSmall(b)
}
return MulIfSmall(a)
}