OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [go.test/] [test/] [interface/] [private.go] - Blame information for rev 700

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 700 jeremybenn
// $G $D/${F}1.go && errchk $G $D/$F.go
2
 
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
 
7
package main
8
 
9
import "./private1"
10
 
11
type Exported interface {
12
        private()
13
}
14
 
15
type Implementation struct{}
16
 
17
func (p *Implementation) private() {}
18
 
19
func main() {
20
        var x Exported
21
        x = new(Implementation)
22
        x.private()
23
 
24
        var px p.Exported
25
        px = p.X
26
 
27
        px.private()                    // ERROR "private"
28
 
29
        px = new(Implementation)        // ERROR "private"
30
 
31
        x = px                          // ERROR "private"
32
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.