Skip to content

Commit 9a217f2

Browse files
committed
CTYP-253 - Remove static/instance flag in check-method
Use the expression argument to infer flag.
1 parent 7ff05e9 commit 9a217f2

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

module-check/src/main/clojure/clojure/core/typed/check.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@
464464
r (get/invoke-get expr expected :cargs cargs)]
465465
(if-not (#{cu/not-special} r)
466466
r
467-
(method/check-invoke-method check expr expected false
467+
(method/check-invoke-method check expr expected
468468
:cargs cargs))))
469469

470470
;FIXME should be the same as (apply hash-map ..) in invoke-apply
@@ -1032,7 +1032,7 @@
10321032
r (nth/invoke-nth check expr expected :cargs cargs)]
10331033
(if-not (#{cu/not-special} r)
10341034
r
1035-
(method/check-invoke-method check expr expected false
1035+
(method/check-invoke-method check expr expected
10361036
:cargs cargs))))
10371037

10381038
;nthnext
@@ -1457,7 +1457,7 @@
14571457
(let [spec (static-method-special expr expected)]
14581458
(if (not= :default spec)
14591459
spec
1460-
(method/check-invoke-method check expr expected false))))
1460+
(method/check-invoke-method check expr expected))))
14611461

14621462
(add-check-method :instance-call
14631463
[expr & [expected]]
@@ -1475,7 +1475,7 @@
14751475
(let [spec (instance-method-special expr expected)]
14761476
(if (not= :default spec)
14771477
spec
1478-
(method/check-invoke-method check expr expected true))))
1478+
(method/check-invoke-method check expr expected))))
14791479

14801480
(add-check-method :static-field
14811481
[expr & [expected]]

module-check/src/main/clojure/clojure/core/typed/check/method.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@
1414
[clojure.core.typed.method-override-env :as mth-override]))
1515

1616
;[MethodExpr Type Any -> Expr]
17-
(defn check-invoke-method [check-fn {c :class method-name :method :keys [args env] :as expr} expected inst?
17+
(defn check-invoke-method [check-fn {c :class method-name :method :keys [args env] :as expr} expected
1818
& {:keys [ctarget cargs method-override]}]
1919
{:pre [((some-fn nil? r/TCResult?) expected)
20-
((some-fn nil? r/Type?) method-override)
21-
(or (not ctarget) inst?)]
20+
((some-fn nil? r/Type?) method-override)]
2221
:post [(-> % u/expr-type r/TCResult?)
2322
(vector? (:args %))]}
2423
(binding [vs/*current-env* env
2524
vs/*current-expr* expr]
26-
(let [method (cu/MethodExpr->Method expr)
25+
(let [inst? (= :instance-call (:op expr))
26+
method (cu/MethodExpr->Method expr)
2727
msym (cu/MethodExpr->qualsym expr)
2828
rfin-type (or method-override
2929
(when msym

module-check/src/main/clojure/clojure/core/typed/check/nth.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
; rewrite nth type to be more useful when we have an exact (and interesting) index.
153153
(nat-value? num-t)
154154
(method/check-invoke-method
155-
check-fn expr expected false
155+
check-fn expr expected
156156
:method-override (nth-function-type (-> num-t :val))
157157
:cargs cargs)
158158
:else cu/not-special)))

0 commit comments

Comments
 (0)