Providing a way to get correct override of TypeRepr in Quotes API #24889
Closed
goshacodes
started this conversation in
Feature Requests
Replies: 2 comments 1 reply
-
|
@goshacodes Could import scala.quoted.*
def resolvedMethodTpe(using qctx: Quotes): TypeRepr = {
import qctx.reflect.*
val newClassSym = Symbol.newClass(...)
val methodSym = newClassSym.methodMember("someMethod").head
// or find methodSym in supertype
val thisType = ThisType(newClassSym)
thisType.memberType(methodSym)
} |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
@neko-kai It worked. Huge thanks! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! Scalamock uses compile time generation where class or trait is inherited.
Some things like path dependent types (if I named it correctly) or this.type is really hard to override. I didn't manage to implement override for this.type correctly.
What I ask as a feature request is to provide a way in Quotes API to get an override of method TypeRepr based on TypeRepr of supertype (or any related TypeRepr containing things like this.type from supertype) and a symbol of generated class.
Beta Was this translation helpful? Give feedback.
All reactions