Skip to content
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

Better stack trace #599

Merged
merged 151 commits into from
Jan 4, 2024
Merged

Better stack trace #599

merged 151 commits into from
Jan 4, 2024

Conversation

adpi2
Copy link
Member

@adpi2 adpi2 commented Sep 27, 2023

No description provided.

@adpi2 adpi2 force-pushed the better-stack-trace branch 2 times, most recently from d37c377 to 9e45477 Compare October 5, 2023 09:10
Copy link
Contributor

@iusildra iusildra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a big one 👏
Just to be sure, you use SAM for Single Abstract Method ?

Copy link
Contributor

@iusildra iusildra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting better! Was it able to find some of the "not found" methods ?

I wonder if it's possible to group all the case classes by "kind" or by a property (maybe with several traits?) to reduce the number of case. There seems to be some patterns but can't tell if it's just a particular case or not

method match
case ByNameArgProxy() => None
case DefaultArg(_) => None
case _ => method.extractFromDecodedNames("(.+)\\$\\d+".r)(_(0))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use triple quotes, so you don't need to put this much \ 😀

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines 48 to 66
case BinaryMethod(_, sym) => formatName(sym)
case BinaryLocalLazyInit(_, sym) => formatName(sym).dot("<lazy init>")
case BinaryLazyInit(_, sym) => formatName(sym).dot("<lazy init>")
case BinaryTraitParamAccessor(_, sym) => formatName(sym)
case BinaryMixinForwarder(_, target) => formatName(target).dot("<mixin forwarder>")
case BinaryTraitStaticForwarder(target) => formatName(target).dot("<static forwarder>")
case _: BinaryOuter => "<outer>"
case BinarySuperArg(_, init, _) => formatName(init).dot("<super arg>")
case BinaryLiftedTry(_, _) => "<try>"
case _: BinaryByNameArg => "<by-name arg>"
case BinaryMethodBridge(target, _) => formatName(target).dot("<bridge>")
case BinaryAnonOverride(_, overridden, _) => formatName(overridden)
case BinaryStaticForwarder(_, target, _) => formatName(target).dot("<static forwarder>")
case _: BinaryDeserializeLambda => "$deserializeLambda$"
case BinarySetter(_, sym, _) => if sym.isMethod then formatName(sym) else formatName(sym) + "_="
case BinarySuperAccessor(_, sym, _) => formatName(sym).dot("<super>")
case BinarySpecializedMethod(_, sym) => formatName(sym).dot("<specialized>")
case BinaryInlineAccessor(_, target) => s"<inline ${formatOwner(target).dot(formatName(target))}>"
case BinaryAdaptedFun(target) => formatName(target).dot("<adapted>")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about having a field stackTraceInfo = "<adapted" | "<lazy init>" |... in BinaryMethodSymbol
Maybe with some trait LocalMethodSymbol and XXXMethodSymbol you could do something like

case m: LocalMethodSymbol => formatQualifiedName(m) // <=> formatQualifiedName(TermSymbol, String)
case m: XXXMethodSymbol => formatQualifiedName(m) // <=> formatQualifiedName(BinaryClassSymbol, TermSymbol, String)
case m: // other special cases such as BinaryOuter

@adpi2 adpi2 force-pushed the better-stack-trace branch 6 times, most recently from b259168 to 0991ca3 Compare January 3, 2024 14:57
@adpi2 adpi2 force-pushed the better-stack-trace branch 8 times, most recently from ec0fd47 to 1e76685 Compare January 4, 2024 12:44
@adpi2 adpi2 marked this pull request as ready for review January 4, 2024 13:41
@adpi2 adpi2 merged commit 20ff51a into scalacenter:main Jan 4, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants