check that current type is the cached type
 if not, change and find method for the type (simple_call to resolve_method)
 conceptually easy in ruby, but we have to compile that "easy" ruby
510792
def cache_check(compiler)
      ok = Mom::Label.new("cache_ok_#{self.object_id}")
      check = build_condition(ok, compiler)      # if cached_type != current_type
      check << Mom::SlotLoad.new([dynamic_call.cache_entry, :cached_type] , receiver_type_definition(compiler))
      check << Mom::ResolveMethod.new( @name , dynamic_call.cache_entry )
      check << ok
    end
1210266
def method_missing(name, *args, **config, &block)
      if respond_to_missing?(name)
        config[:type] = name
        on(*args, config, &block)
      else
        super
      end
    end
529063
static private boolean hasInheritableReplaceMethod (Class type, String methodName) {
		Method method = null;
		Class current = type;
		while (current != null) {
			try {
				method = current.getDeclaredMethod(methodName);
				break;
			} catch (NoSuchMethodException ex) {
				current = current.getSuperclass();
			}
		}
		return ((method != null) && (method.getReturnType() == Object.class));
	}
1273710
function _determineActualTypes(
    env,            // :: Array Type
    seen,           // :: Array Object
    values          // :: Array Any
  ) {
    var expandUnknown4 = expandUnknown (env);

    function refine(types, value) {
      var seen$;
      if (typeof value === 'object' && value != null ||
          typeof value === 'function') {
        //  Abort if a circular reference is encountered; add the current
        //  object to the array of seen objects otherwise.
        if (seen.indexOf (value) >= 0) return [];
        seen$ = Z.concat (seen, [value]);
      } else {
        seen$ = seen;
      }
      var expandUnknown2 = expandUnknown4 (seen$) (value);
      return Z.chain (function(t) {
        return (
          (t.validate (env) (value)).isLeft ?
            [] :
          t.type === UNARY ?
            Z.map (fromUnaryType (t),
                   expandUnknown2 (t.extractors.$1) (t.types.$1)) :
          t.type === BINARY ?
            Z.lift2 (fromBinaryType (t),
                     expandUnknown2 (t.extractors.$1) (t.types.$1),
                     expandUnknown2 (t.extractors.$2) (t.types.$2)) :
          // else
            [t]
        );
      }, types);
    }

    return isEmpty (values) ?
      [Unknown] :
      or (Z.reduce (refine, env, values), [Inconsistent]);
  }
655442
private CacheOpType getCacheOpType(Cache cache, Object[] arguments) {
        CacheOpType opType = cache.opType();
        CacheOpType tmpOpType = CacheHelper.getCacheOpType();
        if (null != tmpOpType) {
            opType = tmpOpType;
        }
        if (null != arguments && arguments.length > 0) {
            for (Object tmp : arguments) {
                if (null != tmp && tmp instanceof CacheOpType) {
                    opType = (CacheOpType) tmp;
                    break;
                }
            }
        }
        if (null == opType) {
            opType = CacheOpType.READ_WRITE;
        }
        return opType;
    }
1110896
def _cachedSqlType(cls):
        
        if not hasattr(cls, "_cached_sql_type"):
            cls._cached_sql_type = cls.sqlType()
        return cls._cached_sql_type
289271
def finalize!
      return if finalized?

      modifiers.each do |modifier|
        modifier.type.each_with_index do |type, i|
          case type
          when :endian, :signedness, :precision, :type, :string_type
            tags[type] = modifier.value[i]
          when :size
            tags[:size] = modifier.value[i] unless tags[:size]
          else
            raise UnknownModifierError,
              "Unknown modifier: #{type}"
          end
        end
      end

      @finalized = true
      cache_string
    end
781497
def method_missing(sym, *args, &block)
      cache_method_call(sym) if ::Builder::XmlBase.cache_method_calls
      tag!(sym, *args, &block)
    end
227774
def _cached_search_compile(pattern, re_verbose, re_version, pattern_type):
    """"""

    return _bregex_parse._SearchParser(pattern, re_verbose, re_version).parse()
51317
def _resolve_to_func(self, what):
        """"""
        if isinstance(what, str):
            what = getattr(Adapter._get_property(self), what)

        # makes it an unbounded function if needed
        if type(what) == types.MethodType:
            what = what.__func__

        if not type(what) == types.FunctionType:
            raise TypeError("Expected a method name, a method or a function")
        return what
1327369
function lookupQualifiedType(qname) {
	var t = type_env.get(qname)
	if (!t)
		throw new TypeError("Unresolved type: " + qname)
	return t;
}
399992
def _cached_replace_compile(pattern, repl, flags, pattern_type):
    """"""

    return _bregex_parse._ReplaceParser().parse(pattern, repl, bool(flags & FORMAT))
1358853
def check_cache(self, type, data, obj=None):
        ''''''
        try:
            id = data['id']
        except:
            # Not an identifiable item
            #print 'don\'t know this item %r:%r' % (type, data)
            return data

        # If obj was passed in, its type takes precedence
        try:
            type = obj._get_type()
        except:
            pass

        # Find the item in the cache, update and return if it's there
        try:
            hit = self.item_cache[type][id]
        except KeyError:
            pass
        else:
            hit._update_data(data)
            #print 'cache hit for %s at %s' % (type, id)
            return hit

        # Not there? Let's make us a new item
        # If we weren't given the object ref, find the name in the global scope
        if not obj:
            # Default to Redmine_Item if it's not found
            obj = self.item_class.get(type, Redmine_Item)

        new_item = obj(redmine=self, data=data, type=type)

        # Store it
        self.item_cache.setdefault(type, {})[id] = new_item
        #print 'set new %s at %s' % (type, id)

        return new_item
1232556
def match_type?(object)
            result = object.kind_of_any? self.type_classes
            if not result
                result = object.type_of_any? self.type_types
            end
            
            return result
        end
1370352
def find_trivial_constructor(type_):
    
    assert isinstance(type_, class_declaration.class_t)

    trivial = type_.constructors(
        lambda x: is_trivial_constructor(x),
        recursive=False,
        allow_empty=True)
    if trivial:
        return trivial[0]

    return None
836612
static Class resolveType(String type) {
        Class cls = Object.class;
        if ("String".equals(type))
            cls = String.class;
        else if ("Integer".equals(type))
            cls = Integer.class;
        else if ("Long".equals(type))
            cls = Long.class;
        else if ("Float".equals(type))
            cls = Float.class;
        else if ("Double".equals(type))
            cls = Double.class;
        else if ("Boolean".equals(type))
            cls = Boolean.class;
        else if ("BigDecimal".equals(type))
            cls = BigDecimal.class;
        else if ("BigInteger".equals(type))
            cls = BigInteger.class;
        else if ("Date".equals(type))
            cls = Date.class;

        return cls;
    }
691596
def target_type(target_type)
      return if target_type.nil?
      return unless [String, Symbol].include?(target_type.class)
      target_type = target_type.to_sym if target_type.instance_of? String
      return unless TARGET_TYPES.include? target_type
      @_target_type = target_type
    end