Using Scala macro to generate function with returned value depending on argument values -


i want write function gets 1 argument (lets call arg: _), , returns option[tuple2] such if arg has field extends mymarkertrait returned tuple (field_name, field_value): tuple2[string, mymarkertrait].

this easy reflection, want @ compile time using macros.

in macro, i'd want return not tuple2[string, mymarkertrait], rather full type of arg second element. if arg is: val arg: mytype mymarkertrait function generated macro should return tuple2[string, mytype mymarkertrait]


Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -