<< Back to previous view

[CTYP-132] typechecker fails when checking a Protocol whose method gets called using dot notation Created: 12/Apr/14  Updated: 18/Jun/14  Resolved: 13/Apr/14

Status: Closed
Project: core.typed
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Daniel Ziltener Assignee: Ambrose Bonnaire-Sergeant
Resolution: Completed Votes: 0
Labels: bug
Environment:

Clojure 1.6.0, core.typed 0.2.44



 Description   

The error message is

No method in multimethod 'check' for dispatch value: :host-interop

The following is a minimal test case which fails:

core.clj
(ns core-typed-bug.core
    (:require [clojure.core.typed :refer :all]))
 
(defprotocol> ITypedTest
    (get-data [this]))
 
(defn> testfn :- Any
    [asdf :- Keyword, in :- ITypedTest]
    (.get-data in))

It works, however, when calling (get-data in) instead of (.get-data in).



 Comments   
Comment by Nicola Mometto [ 12/Apr/14 7:13 PM ]

tools.analyzer.jvm returns a :host-interop node when, like in this case, it encounters an interop form of the form (.foo bar) and can't determine whether it's a no-arg method call or a field-access.

I don't know enough about core.typed internals but it looks like there should be an add-check-method for :host-interop that behaves like check methods for :instance-field/:instance-call that resolve to runtime reflection (not :validated)

Comment by Ambrose Bonnaire-Sergeant [ 13/Apr/14 12:44 AM ]

Thanks Daniel & Nicola, fixed https://github.com/clojure/core.typed/commit/fa22d52d8e9855ebbaf2593ec5e848ba714b25fc

Comment by Daniel Ziltener [ 18/Jun/14 5:40 AM ]

As of version 0.2.51, this still happens reliably.

Generated at Sat Nov 01 05:36:20 CDT 2014 using JIRA 4.4#649-r158309.