Skip to content

Instantly share code, notes, and snippets.

@freakhill
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freakhill/2df1117738362d602672 to your computer and use it in GitHub Desktop.
Save freakhill/2df1117738362d602672 to your computer and use it in GitHub Desktop.
core typed protocol check method too large
/target
/classes
/checkouts
pom.xml
pom.xml.asc
*.jar
*.class
/.lein-*
/.nrepl-port
(ns minimalcase
(:require [ clojure.core.typed :as typed ]))
;; both forms provoke a "method too large" crash at type checking
;; --- case 1 (140 functions in macro generated protocol)
(defmacro build-minimal-case [i]
(concat `(typed/defprotocol PP)
(reduce
(fn [acc i]
(let [f (symbol (str "ff" i))]
(cons `(~f [this#] :- typed/Any) acc)))
'() (range i))))
#_(build-minimal-case 140)
;; --- case 2 (39 functions in protocol)
(typed/defprotocol P
(f00 [this] :- typed/Any)
(f01 [this] :- typed/Any)
(f02 [this] :- typed/Any)
(f03 [this] :- typed/Any)
(f04 [this] :- typed/Any)
(f05 [this] :- typed/Any)
(f06 [this] :- typed/Any)
(f07 [this] :- typed/Any)
(f08 [this] :- typed/Any)
(f09 [this] :- typed/Any)
(f10 [this] :- typed/Any)
(f11 [this] :- typed/Any)
(f12 [this] :- typed/Any)
(f13 [this] :- typed/Any)
(f14 [this] :- typed/Any)
(f15 [this] :- typed/Any)
(f16 [this] :- typed/Any)
(f17 [this] :- typed/Any)
(f18 [this] :- typed/Any)
(f19 [this] :- typed/Any)
(f20 [this] :- typed/Any)
(f21 [this] :- typed/Any)
(f22 [this] :- typed/Any)
(f23 [this] :- typed/Any)
(f24 [this] :- typed/Any)
(f25 [this] :- typed/Any)
(f26 [this] :- typed/Any)
(f27 [this] :- typed/Any)
(f28 [this] :- typed/Any)
(f29 [this] :- typed/Any)
(f30 [this] :- typed/Any)
(f31 [this] :- typed/Any)
(f32 [this] :- typed/Any)
(f33 [this] :- typed/Any)
(f34 [this] :- typed/Any)
(f35 [this] :- typed/Any)
(f36 [this] :- typed/Any)
(f37 [this] :- typed/Any)
(f38 [this] :- typed/Any))
(defproject minimalcase "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/core.typed "0.3.11"
:exclusions [org.clojure/clojure]]]
:profiles {:dev {:plugins [[lein-typed "0.3.5"]]
:dependencies [[org.clojure/clojure "1.7.0"]]}}
:core.typed {:check [minimalcase]}
:source-paths ["."]
:main ^:skip-aot minimalcase
:target-path "target/%s")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment