Github user BuDongDong commented on the pull request:

    https://github.com/apache/storm/pull/312#issuecomment-63250946
  
    @xiaokang the type of real argument is "StormTopology", however the 
"get-task-object" function use a error type declaration "TopologyContext", 
clojure REPL will not raise error. 
    
    you can see this example:
    
    ; SLIME 20100404
    user> (defn get_date_time [^String date] (.getTime date))
    #'user/get_date_time
    user> (def today (java.util.Date.))
    #'user/today
    user> (get_date_time today)
    1416187016658
    user> (def ss (String. "today"))
    #'user/ss
    user> (get_date_time ss)
    
    the "get_date_time" function use a error type declaration "String" to param 
date, however, there is no “getTime” method in class “String”. in fact, 
the "getTime" method is defined by "java.util.Date". (get_date_time today), 
clojure REPL will not raise error; but (get_date_time ss), clojure REPL must 
raise error "No matching field found: getTime for class java.lang.String". the 
question of "get-task-object" function is same as "get_date_time".
    
    because the type of real argument is "StormTopology", "get-task-object" 
calls "get_spouts" and "get_bolts" not raise error, but, if the type of real 
argument is "TopologyContext", "get-task-object" calls "get_spouts" and 
"get_bolts" must raise error. class TopologyContext do not have "get_spouts" 
and "get_bolts" method.
    
    in such a situation, clojure REPL type check will not raise error.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to