MCPcopy Create free account
hub / github.com/golang/mobile / isConsSigSupported

Method isConsSigSupported

bind/genjava.go:355–373  ·  view source on GitHub ↗

isConsSigSupported reports whether the generators can handle a given constructor signature.

(t types.Type)

Source from the content-addressed store, hash-verified

353// isConsSigSupported reports whether the generators can handle a given
354// constructor signature.
355func (g *JavaGen) isConsSigSupported(t types.Type) bool {
356 if !g.isSigSupported(t) {
357 return false
358 }
359 // Skip constructors taking a single int32 argument
360 // since they clash with the proxy constructors that
361 // take a refnum.
362 params := t.(*types.Signature).Params()
363 if params.Len() != 1 {
364 return true
365 }
366 if t, ok := params.At(0).Type().(*types.Basic); ok {
367 switch t.Kind() {
368 case types.Int32, types.Uint32:
369 return false
370 }
371 }
372 return true
373}
374
375// javaTypeName returns the class name of a given Go type name. If
376// the type name clashes with the package class name, an underscore is

Callers 2

genStructMethod · 0.95
genJNIConstructorMethod · 0.95

Calls 3

isSigSupportedMethod · 0.80
TypeMethod · 0.80
LenMethod · 0.45

Tested by

no test coverage detected