@@ -235,7 +235,7 @@ function find_start_brace(s::AbstractString; c_start='(', c_end=')')
235235 braces != 1 && return 0 : - 1 , - 1
236236 method_name_end = reverseind (r, i)
237237 startind = nextind (s, rsearch (s, non_identifier_chars, method_name_end))
238- return startind: endof (s), method_name_end
238+ return ( startind: endof (s), method_name_end)
239239end
240240
241241# Returns the value in a expression if sym is defined in current namespace fn.
@@ -249,18 +249,18 @@ function get_value(sym::Expr, fn)
249249 fn, found = get_value (ex, fn)
250250 ! found && return (nothing , false )
251251 end
252- fn, true
252+ return ( fn, true )
253253end
254254get_value (sym:: Symbol , fn) = isdefined (fn, sym) ? (getfield (fn, sym), true ) : (nothing , false )
255255get_value (sym:: QuoteNode , fn) = isdefined (fn, sym. value) ? (getfield (fn, sym. value), true ) : (nothing , false )
256- get_value (sym, fn) = sym, true
256+ get_value (sym, fn) = ( sym, true )
257257
258258# Return the value of a getfield call expression
259259function get_value_getfield (ex:: Expr , fn)
260260 # Example :((top(getfield))(Base,:max))
261261 val, found = get_value_getfield (ex. args[2 ],fn) # Look up Base in Main and returns the module
262262 found || return (nothing , false )
263- get_value_getfield (ex. args[3 ],val) # Look up max in Base and returns the function if found.
263+ return get_value_getfield (ex. args[3 ], val) # Look up max in Base and returns the function if found.
264264end
265265get_value_getfield (sym, fn) = get_value (sym, fn)
266266
@@ -285,9 +285,9 @@ function get_type_call(expr::Expr)
285285 length (mt) == 1 || return (Any, false )
286286 m = first (mt)
287287 # Typeinference
288- linfo = Base . func_for_method_checked (m[3 ], Tuple{args ... } )
289- (tree, return_type) = Core . Inference . typeinf (linfo, m[ 1 ], m[ 2 ] )
290- return return_type, true
288+ return_type = Core . Inference . typeinf_type (m[3 ], m[ 1 ], m[ 2 ] )
289+ return_type === nothing && return (Any, false )
290+ return ( return_type, true )
291291end
292292# Returns the return type. example: get_type(:(Base.strip("",' ')),Main) returns (String,true)
293293function get_type (sym:: Expr , fn)
@@ -305,7 +305,7 @@ function get_type(sym::Expr, fn)
305305 end
306306 return get_type_call (sym)
307307 end
308- (Any, false )
308+ return (Any, false )
309309end
310310function get_type (sym, fn)
311311 val, found = get_value (sym, fn)
0 commit comments