-
-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix macro crash when handling sealed case classes (#634)
Fixes #628 Sealed classes can be instantiated directly. Therefore, when generating the typeTag, I included the sealed class itself. This ensures that the macro correctly handles sealed classes without subclasses. To check whether it’s a sealed class and not a trait or abstract class, I used the following condition: ``` sealedParents.find(_ == tpe.typeSymbol) ``` Since `trait` and `abstract class` cannot be instantiated, I believe this approach works. However, I could also explicitly check that the symbol is not a trait or an abstract class, if needed. What do you think?
- Loading branch information
Showing
3 changed files
with
18 additions
and
4 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