summaryrefslogtreecommitdiff
path: root/test/files/run/macro-default-params.check
Commit message (Collapse)AuthorAgeFilesLines
* awakens default getter synthesis from the untyper nightmareEugene Burmako2014-01-071-0/+1
Our happy little macro paradise is regularly invaded by resetAllAttrs, the bane of all macros and typers. It’s so ruthless and devastating that we’ve been long scheming to hack something really cool and to one day defeat it. Today we make the first step towards the happy future. Today we overthrow the UnTyper, resetAllAttrs’s elder brother that rules in the kingdoms of GetterLand and CaseClassia, and banish him from the land of getters. In the name of what’s good and meta, let’s band together and completely drive him away in a subsequent pull request! To put it in a nutshell, instead of using untyper on a DefDef to do default getter synthesis, the commit duplicates the DefDef and does resetLocalAttrs on it. As default getter synthesis proceeds with figuring out type and value parameters for the getter, then its tpt and finally its rhs, the commit destructures the duplicated DefDef and then assembles the default getter from the destructured parts instead of doing copyUntyped/copyUntypedInvariant on the original DefDef. I would say the test coverage is pretty good, as I had to figure out 3 or 4 test failures before I got to the stage when everything worked. Iirc it tests pretty exotic stuff like polymorphic default parameters in both second and third parameter lists, so it looks like we're pretty good in this department.