-
-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tweak macro to allow more than 22 inputs (#1623)
Fixes #910 Basically we avoid using the statically typed `zipMap` methods which cap out at 22, and instead use an untyped `zipMapLong` method that works with `IndexedSeq[T[Any]]` and `IndexedSeq[Any]`s. This could conceivably result in runtime errors if the macro has bugs, but assuming the macro is correct then it's as safe for the user as the existing macro is By removing the old implementation, we are able to cut out a considerable amount of complexity from the codebase while still maintaining the existing semantics. Performance is probably better after, since we're just removing a layer of indirection: previously we ended up going through this dynamic `Seq[Any]` anyway, we just had a statically-typed facade wrapping it Tested with a unit test, also tested manually in the `scratch` folder on the following build: ```scala def t1 = T{ 1 } def t2 = T{ 2 } def t3 = T{ 3 } def t4 = T{ 4 } def t5 = T{ 5 } def t6 = T{ 6 } def t7 = T{ 7 } def t8 = T{ 8 } def t9 = T{ 9 } def t10 = T{ 10 } def t11 = T{ 11 } def t12 = T{ 12 } def t13 = T{ 13 } def t14 = T{ 14 } def t15 = T{ 15 } def t16 = T{ 16 } def t17 = T{ 17 } def t18 = T{ 18 } def t19 = T{ 19 } def t20 = T{ 20 } def t21 = T{ 21 } def t22 = T{ 22 } def t23 = T{ 23 } def sum = T{ t1() + t2() + t3() + t4() + t5() + t6() + t7() + t8() + t9() + t10() + t11() + t12() + t13() + t14() + t15() + t16() + t17() + t18() + t19() + t20() + t21() + t22() + t23() } ``` This passes on this PR, fails on master.
- Loading branch information
Showing
7 changed files
with
66 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters