Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't easily make a generic tuple #43

Open
timsgardner opened this issue May 1, 2019 · 1 comment
Open

can't easily make a generic tuple #43

timsgardner opened this issue May 1, 2019 · 1 comment
Labels
generics Support for CLR generics in MAGIC

Comments

@timsgardner
Copy link
Contributor

timsgardner commented May 1, 2019

Would be nice if this worked:

(m/faster
  (System.Tuple/Create :a :b))

Instead, throws:

clojure.lang.ExceptionInfo: Could not find static method Create with args [clojure.lang.Keyword clojure.lang.Keyword] for type System.Tuple while analyzing form (System.Tuple/Create :a :b)
* magic/analyzer/errors/fn
* clojure.lang.MultiFn
* magic/analyzer/analyze-host-forms/analyze-host-call
* clojure.lang.Var
* clojure/tools/analyzer/passes/compile-passesfnfn
* clojure/tools/analyzer/passes/compile-passesfnfn
* clojure/core/partialfn
* clojure/tools/analyzer/ast/walkwalk
* clojure/tools/analyzer/ast/walkwalkwalk
* clojure/tools/analyzer/ast/-update-childrenfn
* clojure.lang.PersistentVector.reduce
* clojure/core/reduce
* clojure/tools/analyzer/ast/-update-children
* clojure/tools/analyzer/ast/update-children-reduced
* clojure/tools/analyzer/ast/walkwalk
* clojure/tools/analyzer/ast/walkwalkwalk
* clojure/tools/analyzer/ast/-update-childrenfn
* clojure.lang.PersistentVector.reduce
* clojure/core/reduce
* clojure/tools/analyzer/ast/-update-children
* clojure/tools/analyzer/ast/update-children-reduced
* clojure/tools/analyzer/ast/walkwalk
* clojure/tools/analyzer/ast/walkwalkwalk
* clojure/tools/analyzer/ast/-update-childrenfn
* clojure.lang.PersistentVector.reduce
* clojure/core/reduce
* clojure/tools/analyzer/ast/-update-children
* clojure/tools/analyzer/ast/update-children-reduced
* clojure/tools/analyzer/ast/walkwalk
* clojure/tools/analyzer/ast/walkwalkwalk
* clojure/tools/analyzer/utils/mapv'
* clojure/tools/analyzer/ast/-update-childrenfn
* clojure.lang.PersistentVector.reduce
* clojure/core/reduce
* clojure/tools/analyzer/ast/-update-children
* clojure/tools/analyzer/ast/update-children-reduced
* clojure/tools/analyzer/ast/walkwalk
* clojure/tools/analyzer/ast/walk
* clojure/tools/analyzer/ast/postwalk
* clojure/tools/analyzer/passes/compile-passesanalyze
* clojure/core/compfn
* magic/analyzer/analyze
* magic/faster/faster-type
* magic/api/faster
* clojure.lang.RestFn
* clojure.lang.Var
  clojure.lang.Compiler.MacroexpandSeq1 (clojure.lang.ISeq)
  clojure.lang.Compiler.macroexpand1 (object)
  clojure.lang.Compiler.Macroexpand (object)
  clojure.lang.Compiler.eval (object)
  clojure.lang.Compiler.eval (object)
* clojure/core/eval
* arcadia/internal/socket-repl/game-thread-evalfnfn

Without Magic, the following works:

(System.Tuple/Create (type-args clojure.lang.Keyword, clojure.lang.Keyword) :a :b)

but the type-args defeat the purpose, you might as well construct the Tuple directly. In Magic, this doesn't work:

(m/faster
  (System.Tuple/Create (type-args clojure.lang.Keyword, clojure.lang.Keyword) :a :b))

throws:

clojure.lang.ExceptionInfo: Could not find static method Create with args [System.Object clojure.lang.Keyword clojure.lang.Keyword] for type System.Tuple while analyzing form (System.Tuple/Create (type-args clojure.lang.Keyword clojure.lang.Keyword) :a :b)
* magic/analyzer/errors/fn
* clojure.lang.MultiFn
* magic/analyzer/analyze-host-forms/analyze-host-call
* clojure.lang.Var
* clojure/tools/analyzer/passes/compile-passesfnfn
* clojure/tools/analyzer/passes/compile-passesfnfn
* clojure/core/partialfn
* clojure/tools/analyzer/ast/walkwalk
* clojure/tools/analyzer/ast/walkwalkwalk
* clojure/tools/analyzer/ast/-update-childrenfn
* clojure.lang.PersistentVector.reduce
* clojure/core/reduce
* clojure/tools/analyzer/ast/-update-children
* clojure/tools/analyzer/ast/update-children-reduced
* clojure/tools/analyzer/ast/walkwalk
* clojure/tools/analyzer/ast/walkwalkwalk
* clojure/tools/analyzer/ast/-update-childrenfn
* clojure.lang.PersistentVector.reduce
* clojure/core/reduce
* clojure/tools/analyzer/ast/-update-children
* clojure/tools/analyzer/ast/update-children-reduced
* clojure/tools/analyzer/ast/walkwalk
* clojure/tools/analyzer/ast/walkwalkwalk
* clojure/tools/analyzer/ast/-update-childrenfn
* clojure.lang.PersistentVector.reduce
* clojure/core/reduce
* clojure/tools/analyzer/ast/-update-children
* clojure/tools/analyzer/ast/update-children-reduced
* clojure/tools/analyzer/ast/walkwalk
* clojure/tools/analyzer/ast/walkwalkwalk
* clojure/tools/analyzer/utils/mapv'
* clojure/tools/analyzer/ast/-update-childrenfn
* clojure.lang.PersistentVector.reduce
* clojure/core/reduce
* clojure/tools/analyzer/ast/-update-children
* clojure/tools/analyzer/ast/update-children-reduced
* clojure/tools/analyzer/ast/walkwalk
* clojure/tools/analyzer/ast/walk
* clojure/tools/analyzer/ast/postwalk
* clojure/tools/analyzer/passes/compile-passesanalyze
* clojure/core/compfn
* magic/analyzer/analyze
* magic/faster/faster-type
* magic/api/faster
* clojure.lang.RestFn
* clojure.lang.Var
  clojure.lang.Compiler.MacroexpandSeq1 (clojure.lang.ISeq)
  clojure.lang.Compiler.macroexpand1 (object)
  clojure.lang.Compiler.Macroexpand (object)
  clojure.lang.Compiler.eval (object)
  clojure.lang.Compiler.eval (object)
* clojure/core/eval
* arcadia/internal/socket-repl/game-thread-evalfnfn
@nasser
Copy link
Owner

nasser commented May 6, 2019

Notably the following also breaks

(m/faster (System.Tuple/Create|[System.Int64 System.Int64]| 1 2))

@nasser nasser added the generics Support for CLR generics in MAGIC label Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generics Support for CLR generics in MAGIC
Projects
None yet
Development

No branches or pull requests

2 participants