-
Notifications
You must be signed in to change notification settings - Fork 531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mkAttributedRef specialized for SingleType #994
Conversation
References to singleton types should refer to the getter if possible. Fixes an issue where we would try to reference a non-existing field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one!
@@ -1017,7 +1021,7 @@ class GenericMacros(val c: whitebox.Context) extends CaseClassMacros { | |||
} | |||
|
|||
def mkProductGeneric(tpe: Type): Tree = { | |||
val repr = mkHListTypTree(fieldsOf(tpe).map(_._2)) | |||
val repr = mkHListTpe(fieldsOf(tpe).map(_._2)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now mkHListTypTree
is not used in shapeless anymore.
But it might be wise to keep it because people might be using it in their own macros.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine removing it for 2.4.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok it turns out there is a lot of dead code already 😄
case _ => | ||
cq"_: $tpe0 => $index" | ||
} | ||
|
||
val coproduct = objectRef[Coproduct.type] | ||
val ctors = ctorsOf(tpe) | ||
val repr = mkCoproductTypTree(ctors) | ||
val repr = mkCoproductTpe(ctors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now mkCoproductTypTree
is not used in shapeless anymore.
But it might be wise to keep it because people might be using it in their own macros.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
Latest nightly was green ... we're good to go 😄 |
References to singleton types should refer to the getter if possible.
Fixes an issue where we would try to reference a non-existing field.