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

java - Could not locate OpenAL library -

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

sorting - opencl Bitonic sort with 64 bits keys -