Esempio n. 1
0
  protected boolean hasSelfArgument() {
    Class<?> clazz = getObjectType();
    if (clazz == null) {
      return false;
    }
    List<SkylarkType> types = signature.getTypes();
    ImmutableList<String> names = signature.getSignature().getNames();

    return (!types.isEmpty() && types.get(0).canBeCastTo(clazz))
        || (!names.isEmpty() && names.get(0).equals("self"));
  }
Esempio n. 2
0
 /** Configure a function based on its signature */
 protected void configure() {
   // this function is called after the signature was initialized
   Preconditions.checkState(signature != null);
   enforcedArgumentTypes = signature.getTypes();
 }