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

TastyInspector sometimes return EmptyTree for tasty files #12669

Open
BarkingBad opened this issue Jun 1, 2021 · 5 comments
Open

TastyInspector sometimes return EmptyTree for tasty files #12669

BarkingBad opened this issue Jun 1, 2021 · 5 comments
Assignees
Labels
area:tasty-inspector issues relating to the TASTy inspector exp:intermediate itype:bug

Comments

@BarkingBad
Copy link
Contributor

BarkingBad commented Jun 1, 2021

https://github.com/BarkingBad/tasty-bug

sbt:scala3-simple> run
[info] running Main$package 
Class Name:
src/main/resources/tasties/B_rename.tasty
AST:
class dotty.tools.dotc.ast.Trees$PackageDef

Class Name:
src/main/resources/tasties/A.tasty
AST:
class dotty.tools.dotc.ast.Trees$PackageDef

How many Array.tasty files are there:
8
How many Array.tasty files with different size are there: 
1
Class Name:
src/main/resources/tasties/Array.tasty
AST:
class dotty.tools.dotc.ast.Trees$EmptyTree

Class Name:
src/main/resources/tasties/scala/Array.tasty
AST:
class dotty.tools.dotc.ast.Trees$PackageDef  // <--------------------- The only correct read of Array.tasty file

Class Name:
src/main/resources/tasties/scala/Array11.tasty
AST:
class dotty.tools.dotc.ast.Trees$EmptyTree

Class Name:
src/main/resources/tasties/dir/Array.tasty
AST:
class dotty.tools.dotc.ast.Trees$EmptyTree

Class Name:
src/main/resources/tasties/dir/scala/Array.tasty
AST:
class dotty.tools.dotc.ast.Trees$EmptyTree

Class Name:
src/main/resources/tasties/dir/scala/Array11.tasty
AST:
class dotty.tools.dotc.ast.Trees$EmptyTree

Class Name:
src/main/resources/tasties/dir/Array11.tasty
AST:
class dotty.tools.dotc.ast.Trees$EmptyTree

Class Name:
src/main/resources/tasties/Array11.tasty
AST:
class dotty.tools.dotc.ast.Trees$EmptyTree

TastyInspector correctly loads A and B tasty files, though they are at resources/tasties/ path

TastyInspector incorrectly loads many combinations of Array.tasty stdlib tasty file unless it is exactly at scala/Array.tasty path suffix with companion .class file. Otherwise, it returns EmptyTree

It's worth noting that A and B files load correctly even with

  • different names than original
  • different paths suffix
  • no .class file at the same directory
@BarkingBad BarkingBad added the area:tasty-format issues relating to TASTy as a portable standard label Jun 1, 2021
@bishabosha bishabosha added area:tasty-inspector issues relating to the TASTy inspector and removed area:tasty-format issues relating to TASTy as a portable standard labels Jun 1, 2021
@anatoliykmetyuk anatoliykmetyuk added Spree Suitable for a future Spree exp:intermediate labels Jul 20, 2021
@scala-center-bot
Copy link

This issue was picked for the Issue Spree No. 24 of 29 November 2022 which takes place in a week from now. @issackurian, @rjolly will be working on it. If you have any insight into the issue or guidance on how to fix it, please leave it here.

@scala-center-bot
Copy link

This issue was picked for the Issue Spree No. 25 of 24 January 2023 which takes place in a week from now. @issackurian, @mbovel will be working on it. If you have any insight into the issue or guidance on how to fix it, please leave it here.

@mbovel
Copy link
Member

mbovel commented Jan 24, 2023

@issackurian, @rjolly: I see that you already worked on this issue during a previous Spree. What was the status?

@issackurian
Copy link

issackurian commented Jan 24, 2023 via email

@mbovel
Copy link
Member

mbovel commented Jan 24, 2023

I see. Yes we can work on this PR together along with @rjolly (my bad, I see @rjolly will work on 16250 today) during tonight's spree.

I made a branch that adds the test case in the description as a Dotty test in case it might be useful: dotty-staging@ca1201d.

See you tonight!

issackurian pushed a commit to issackurian/dotty that referenced this issue Jan 24, 2023
However, the A.tasty and B_rename.tasty files from the repo in the issue
don't seem to load inside the dotty repo ???
@mbovel mbovel removed the Spree Suitable for a future Spree label Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:tasty-inspector issues relating to the TASTy inspector exp:intermediate itype:bug
Projects
None yet
Development

No branches or pull requests

7 participants