virtuslab / pretty-stacktraces Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
Calling function by name.apply(...)
generate the same bytecode as name(...)
, but generated TASTY tree contains additional level of nested $anonfun
. Can be problematic while disambiguating such functions called inside of another lambda.
If a tasty file of an incompatible version is passed to the inspectStackTrace
method, the error message is uncondittionally printed to stderr. There's no way to suspend it. The method should indeed return error but it should not pollute stderr without user's knowledge.
In the case below, the "Runner.tasty" file was built with scala 3.0.2, while the script is using 3.1.0.
Repro
// using scala "3.1.0"
// using lib "org.virtuslab::pretty-stacktraces:0.0.1-M1"
import org.virtuslab.stacktraces.core.StacktracesInspector
import java.io.File
import scala.util.Try
@main def main = {
val ex = new Exception("")
val e = ex.getStackTrace.head
Try{StacktracesInspector.inspectStackTrace(e, new File("/tmp/runner_3.jar_sources3392797399715882651/scala/cli/runner/Runner.tasty"))}
}
Expected:
No output
Actual:
Prints
error while loading Typeable$package$,
class file scala/reflect/Typeable$package.class is broken, reading aborted with class dotty.tools.tasty.UnpickleException
TASTy signature has wrong version.
expected: {majorVersion: 28, minorVersion: 0}
found : {majorVersion: 28, minorVersion: 1}
This TASTy file was produced by a more recent, forwards incompatible release.
To read this TASTy file, please upgrade your tooling.
The TASTy file was produced by Scala 3.1.0-bin-nonbootstrapped.
error while loading Quotes$package$,
class file scala/quoted/Quotes$package.class is broken, reading aborted with class dotty.tools.tasty.UnpickleException
TASTy signature has wrong version.
expected: {majorVersion: 28, minorVersion: 0}
found : {majorVersion: 28, minorVersion: 1}
This TASTy file was produced by a more recent, forwards incompatible release.
To read this TASTy file, please upgrade your tooling.
The TASTy file was produced by Scala 3.1.0-bin-nonbootstrapped.
error while loading Expr$,
class file scala/quoted/runtime/Expr.class is broken, reading aborted with class dotty.tools.tasty.UnpickleException
TASTy signature has wrong version.
expected: {majorVersion: 28, minorVersion: 0}
found : {majorVersion: 28, minorVersion: 1}
This TASTy file was produced by a more recent, forwards incompatible release.
To read this TASTy file, please upgrade your tooling.
The TASTy file was produced by Scala 3.1.0-bin-nonbootstrapped.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.