2008-10-08 10:21:57 -06:00
|
|
|
// errchk $G $D/$F.go
|
|
|
|
|
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
type Inst interface {
|
|
|
|
Next() *Inst;
|
|
|
|
}
|
|
|
|
|
|
|
|
type Regexp struct {
|
2008-12-18 23:37:22 -07:00
|
|
|
code []Inst;
|
2008-10-08 10:21:57 -06:00
|
|
|
start Inst;
|
|
|
|
}
|
|
|
|
|
|
|
|
type Start struct {
|
|
|
|
foo *Inst;
|
|
|
|
}
|
|
|
|
|
|
|
|
func (start *Start) Next() *Inst { return nil }
|
|
|
|
|
|
|
|
|
|
|
|
func AddInst(Inst) *Inst {
|
|
|
|
print("ok in addinst\n");
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
2009-01-06 16:19:02 -07:00
|
|
|
re := new(Regexp);
|
2008-10-08 10:21:57 -06:00
|
|
|
print("call addinst\n");
|
2009-01-06 16:19:02 -07:00
|
|
|
var x Inst = AddInst(new(Start)); // ERROR "illegal|incompatible"
|
2008-10-08 10:21:57 -06:00
|
|
|
print("return from addinst\n");
|
|
|
|
}
|