Closed riedelcastro closed 10 years ago
Have a look at 2def4a507b71b0d1344f1e16f4922d057bb197d0. The inliner should be used incrementally during matching.
Cool! Two very basic questions for my understanding:
inlineOnce
already typed? Inliner
companion object already avoid the problem of "method name matches" by working with Symbols in definitions
?
- Is the tree that I get by calling inlineOnce already typed?
Yes! It's unfortunate that this doesn't really show in the Spec right now.
- Does the Inliner companion object already avoid the problem of "method name matches" by working with Symbols in definitions?
Yes, at least at the inlining level. The other problem is that a lot of pattern matching afterwards is still done by name.
Done by using inlineOnce in
https://github.com/wolfe-pack/wolfe/blob/dev/src/main/scala/ml/wolfe/macros/CodeRepository.scala
S
Currently pattern matching on ASTs happens partly on untyped trees (those we get through inlining of other trees in the enclosed class). Only the arguments to the macro are typed. This means that we are often checking for method name matches, which can be risky. Ideally all trees we match on should be typed.
Connected to #40: ideally ASTs should incrementally enter the macro code, and always in a typed fashion. There should be a class responsible for this functionality.