Skip to content

ilinandrii/scala3-macro-experiments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Experiments with macros in scala 3

Current macro is a POC that collects instances of a specific type (in current implementation Strings) into a list, given an application built with traits containing those instances.

Helpful resources for learning scala 3 macros:

TODOs:

  • Find a way to force a user to always use a macro method instead of building a list manually. Maybe through some implicit (given). As far as I can see that's not possible at the moment, because macro cannot mutate context AST, like adding some given instances to an application passed as a parameter to a macro. Maybe it will be possible in the future, say through an explicit tree typechecking. 🤷‍
  • Examine self type annotation to determine which traits should be considered for search for a specific type instances also consider using an inheritance instead.
  • Use some real-world examples

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages