-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Backend crash when inlined method contains try #2056
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
Comments
It's not due to backend. |
Are you sure? There are many cases where PackageDef(Ident(<empty>), List(
TypeDef(Test,
Template(
DefDef(<init>, List(), List(List()), TypeTree(),
Block(List(
Apply(Select(Super(This(Ident(Test)), Ident()), <init>), List())
), Literal(()))
)
, List(TypeTree()), ValDef(_, Thicket(List()), Thicket(List())), List())
)
)) |
Here's the tree of my original example that crashes: PackageDef(Ident(<empty>), List(
TypeDef(Test$,
Template(
DefDef(<init>, List(), List(List()), TypeTree(),
Block(List(
Apply(Select(Super(This(Ident(Test$)), Ident()), <init>), List())
), Literal(()))
)
, List(TypeTree()), ValDef(_, Thicket(List()), Thicket(List())), List(
DefDef(crash, List(), List(List()), TypeTree(),
Try(Apply(Ident(println), List(Literal("hi"))), List(), Thicket(List()))
)
,
DefDef(main, List(), List(List(ValDef(args, TypeTree(), Thicket(List()))))
,
TypeTree(),
Try(Apply(Ident(println), List(Literal("hi"))), List(), Thicket(List()))
)
))
)
,ValDef(Test, TypeTree(), Apply(Select(New(TypeTree()), <init>), List())))) I can't see any difference between |
@smarter, I've meant the method bodies. The Backend ignores the high-level tree structure of packages and classes and uses types instead. |
Found the issue, will make a PR soon. |
In various places we do "case EmptyTree =>", since Tree#equals uses reference equality this means that EmptyTree should never be copied, otherwise some other code path will be taken.
In various places we do "case EmptyTree =>", since Tree#equals uses reference equality this means that EmptyTree should never be copied, otherwise some other code path will be taken.
Fix #2056: Backend crash when inlined method contains try
The text was updated successfully, but these errors were encountered: