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

Make sure that trace is shown correctly in the presence of invalid line numbers #18930

Merged
merged 2 commits into from
Nov 17, 2023

Conversation

liufengyun
Copy link
Contributor

@liufengyun liufengyun commented Nov 15, 2023

Make sure that trace is shown correctly in the presence of invalid line numbers (-1) in TASTy.

Before:

Reading mutable state of object Array during initialization of object Parent.
Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: 
-> object Parent {                    // error  [ t9312.scala:11 ]
   ^
-> final val children = Set(Child1, Child2)     [ t9312.scala:21 ]
                        ^^^^^^^^^^^^^^^^^^^
-> BitmapIndexedSetNode.this.originalHashes.apply(index)

After:

Reading mutable state of object Array during initialization of object Parent.
Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace:
├── object Parent {                    // error	[ t9312.scala:11 ]
      ^
├── final val children = Set(Child1, Child2)	[ t9312.scala:21 ]
                        ^^^^^^^^^^^^^^^^^^^
├── scala.collection.IterableFactory.apply
├── IterableFactory.this.from[A](elems)
├── scala.collection.immutable.Set.from
├── scala.collection.immutable.Set.newBuilder[E].addAll(it)
├── scala.collection.immutable.SetBuilderImpl.addAll
├── super.addAll(xs)
├── scala.collection.mutable.Growable.addAll
├── Growable.this.addOne(it.next())
├── scala.collection.immutable.SetBuilderImpl.addOne
├── SetBuilderImpl.this.hashSetBuilder.addOne(elem)
├── scala.collection.immutable.HashSetBuilder.addOne
├── HashSetBuilder.this.update(HashSetBuilder.this.rootNode, elem, h, im, 0)
├── scala.collection.immutable.HashSetBuilder.update
├── bm.getHash(index)
├── scala.collection.immutable.BitmapIndexedSetNode.getHash
└── BitmapIndexedSetNode.this.originalHashes.apply(index)

Ref: #18882

@liufengyun
Copy link
Contributor Author

This PR does not fix #18882. The fix will coming next.

Copy link
Contributor

@olhotak olhotak left a comment

Choose a reason for hiding this comment

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

It looks like the position markers (^^^) are now misaligned due to the changes in indentation.

@liufengyun
Copy link
Contributor Author

It looks like the position markers (^^^) are now misaligned due to the changes in indentation.

Good catch, now I fixed the misalignment.

Copy link
Contributor

@olhotak olhotak left a comment

Choose a reason for hiding this comment

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

LGTM

@liufengyun liufengyun merged commit 7d2cad5 into scala:main Nov 17, 2023
18 checks passed
@liufengyun liufengyun deleted the fix-i18882 branch November 17, 2023 06:38
@Kordyjan Kordyjan added this to the 3.4.0 milestone Dec 20, 2023
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