blob: fac0e36289493ddce6370fb84bd9d9e242e0b405 [file] [log] [blame]
Rémy Oudompheng2ece2f52012-02-18 22:15:42 +01001// run
Russ Cox815a1b82011-04-23 10:54:19 -04002
3// Copyright 2011 The Go Authors. All rights reserved.
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7package main
8
Russ Cox44526cd2011-11-01 22:06:05 -04009import "io"
Russ Cox815a1b82011-04-23 10:54:19 -040010
Russ Cox44526cd2011-11-01 22:06:05 -040011func f() (_ string, x float64, err error) {
Russ Cox815a1b82011-04-23 10:54:19 -040012 return
13}
14
Russ Cox44526cd2011-11-01 22:06:05 -040015func g() (_ string, x float64, err error) {
16 return "hello", 3.14, io.EOF
Russ Cox815a1b82011-04-23 10:54:19 -040017}
18
Russ Cox44526cd2011-11-01 22:06:05 -040019var _ func() (string, float64, error) = f
20var _ func() (string, float64, error) = g
Russ Cox815a1b82011-04-23 10:54:19 -040021
22func main() {
23 x, y, z := g()
Russ Cox44526cd2011-11-01 22:06:05 -040024 if x != "hello" || y != 3.14 || z != io.EOF {
Russ Cox815a1b82011-04-23 10:54:19 -040025 println("wrong", x, len(x), y, z)
26 }
27}
28
29/*
30issue 1712
31
32bug331.go:12: cannot use "hello" (type string) as type float64 in assignment
33bug331.go:12: cannot use 0 (type float64) as type os.Error in assignment:
34 float64 does not implement os.Error (missing String method)
35bug331.go:12: error in shape across RETURN
36*/