Debian Codegraph @

gcc/testsuite/go.test/test/fixedbugs/bug345.dir/main.go

raw
1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package main
6
7 import (
8 "bufio"
9 goio "io"
10
11 "./io"
12 )
13
14 func main() {
15 // The errors here complain that io.X != io.X
16 // for different values of io so they should be
17 // showing the full import path, which for the
18 // "./io" import is really ..../go/test/io.
19 // For example:
20 //
21 // main.go:25: cannot use w (type "/Users/rsc/g/go/test/fixedbugs/bug345.dir/io".Writer) as type "io".Writer in function argument:
22 // io.Writer does not implement io.Writer (missing Write method)
23 // main.go:27: cannot use &x (type *"io".SectionReader) as type *"/Users/rsc/g/go/test/fixedbugs/bug345.dir/io".SectionReader in function argument
24
25 var w io.Writer
26 bufio.NewWriter(w) // ERROR "[\w.]+[^.]/io|has incompatible type"
27 var x goio.SectionReader
28 io.SR(&x) // ERROR "[\w.]+[^.]/io|has incompatible type"
29 }