bind: rename parameter p
Fixes golang/go#11064. Change-Id: Idb4376f0143b0d1c8e87e7ccc54aae343b504e4a Reviewed-on: https://go-review.googlesource.com/10689 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This commit is contained in:
parent
c533dca65f
commit
f373bd373c
@ -385,7 +385,7 @@ func (g *javaGen) javaTypeDefault(T types.Type) string {
|
||||
}
|
||||
}
|
||||
|
||||
var paramRE = regexp.MustCompile(`^p[0-9]+$`)
|
||||
var paramRE = regexp.MustCompile(`^p[0-9]*$`)
|
||||
|
||||
// paramName replaces incompatible name with a p0-pN name.
|
||||
// Missing names, or existing names of the form p[0-9] are incompatible.
|
||||
|
4
bind/testdata/interfaces.go
vendored
4
bind/testdata/interfaces.go
vendored
@ -19,3 +19,7 @@ type seven struct{}
|
||||
func (seven) Rand() int32 { return 7 }
|
||||
|
||||
func Seven() I { return seven{} }
|
||||
|
||||
type WithParam interface {
|
||||
HasParam(p bool)
|
||||
}
|
||||
|
24
bind/testdata/interfaces.go.golden
vendored
24
bind/testdata/interfaces.go.golden
vendored
@ -51,6 +51,30 @@ func proxy_Seven(out, in *seq.Buffer) {
|
||||
out.WriteGoRef(res)
|
||||
}
|
||||
|
||||
const (
|
||||
proxyWithParam_Descriptor = "go.interfaces.WithParam"
|
||||
proxyWithParam_HasParam_Code = 0x10a
|
||||
)
|
||||
|
||||
func proxyWithParam_HasParam(out, in *seq.Buffer) {
|
||||
ref := in.ReadRef()
|
||||
v := ref.Get().(interfaces.WithParam)
|
||||
param_p0 := in.ReadBool()
|
||||
v.HasParam(param_p0)
|
||||
}
|
||||
|
||||
func init() {
|
||||
seq.Register(proxyWithParam_Descriptor, proxyWithParam_HasParam_Code, proxyWithParam_HasParam)
|
||||
}
|
||||
|
||||
type proxyWithParam seq.Ref
|
||||
|
||||
func (p *proxyWithParam) HasParam(p0 bool) {
|
||||
in := new(seq.Buffer)
|
||||
in.WriteBool(p0)
|
||||
seq.Transact((*seq.Ref)(p), proxyWithParam_HasParam_Code, in)
|
||||
}
|
||||
|
||||
func init() {
|
||||
seq.Register("interfaces", 1, proxy_Add3)
|
||||
seq.Register("interfaces", 2, proxy_Seven)
|
||||
|
52
bind/testdata/interfaces.java.golden
vendored
52
bind/testdata/interfaces.java.golden
vendored
@ -81,6 +81,58 @@ public abstract class Interfaces {
|
||||
return _result;
|
||||
}
|
||||
|
||||
public interface WithParam extends go.Seq.Object {
|
||||
public void HasParam(boolean p0);
|
||||
|
||||
public static abstract class Stub implements WithParam {
|
||||
static final String DESCRIPTOR = "go.interfaces.WithParam";
|
||||
|
||||
private final go.Seq.Ref ref;
|
||||
public Stub() {
|
||||
ref = go.Seq.createRef(this);
|
||||
}
|
||||
|
||||
public go.Seq.Ref ref() { return ref; }
|
||||
|
||||
public void call(int code, go.Seq in, go.Seq out) {
|
||||
switch (code) {
|
||||
case Proxy.CALL_HasParam: {
|
||||
boolean param_p0;
|
||||
param_p0 = in.readBool();
|
||||
this.HasParam(param_p0);
|
||||
return;
|
||||
}
|
||||
default:
|
||||
throw new RuntimeException("unknown code: "+ code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static final class Proxy implements WithParam {
|
||||
static final String DESCRIPTOR = Stub.DESCRIPTOR;
|
||||
|
||||
private go.Seq.Ref ref;
|
||||
|
||||
Proxy(go.Seq.Ref ref) { this.ref = ref; }
|
||||
|
||||
public go.Seq.Ref ref() { return ref; }
|
||||
|
||||
public void call(int code, go.Seq in, go.Seq out) {
|
||||
throw new RuntimeException("cycle: cannot call proxy");
|
||||
}
|
||||
|
||||
public void HasParam(boolean p0) {
|
||||
go.Seq _in = new go.Seq();
|
||||
go.Seq _out = new go.Seq();
|
||||
_in.writeRef(ref);
|
||||
_in.writeBool(p0);
|
||||
Seq.send(DESCRIPTOR, CALL_HasParam, _in, _out);
|
||||
}
|
||||
|
||||
static final int CALL_HasParam = 0x10a;
|
||||
}
|
||||
}
|
||||
|
||||
private static final int CALL_Add3 = 1;
|
||||
private static final int CALL_Seven = 2;
|
||||
private static final String DESCRIPTOR = "interfaces";
|
||||
|
Loading…
x
Reference in New Issue
Block a user