-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add compilation unit info to ClassSymbol
#19010
Merged
bishabosha
merged 10 commits into
scala:main
from
dotty-staging:keep-compilation-unit-info-in-symbol
Nov 23, 2023
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5e714dd
Add `CompilationUnitInfo` to `ClassSymbol`
nicolasstucki 83c05b6
Keep `TastyVersion` in `CompilationUnitInfo`
nicolasstucki ff0b153
Allow `infix enum`
nicolasstucki 8b44ffa
Deprecation warnings for old syntax: alphanumeric infix operators
nicolasstucki 0291fa8
Read TASTy header eagerly to avoid var in CompilationUnitInfo
nicolasstucki 91f8e3a
Add explicit nulls tasty attribute to CompilationUnit
nicolasstucki 2f36da4
Set explicit nulls in CompilationUnitInfo symbols from source
nicolasstucki e152b56
Review feedback
nicolasstucki 97d8171
Cache stable TASTyVersion
nicolasstucki 050859e
add scala3 library to tasty-core-scala2 project
bishabosha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//> using options -Werror | ||
|
||
import language.`3.4` | ||
|
||
class Foo: | ||
def x(i: Int) = i | ||
infix def y(i: Int) = i | ||
|
||
def test(foo: Foo): Unit = | ||
foo x 1 // error (because it was compiled with 3.4+) | ||
foo y 2 // ok: is marked as infix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- Error: tests/neg/alphanumeric-infix-operator.scala:8:6 -------------------------------------------------------------- | ||
8 | foo x 1 // error (because it was compiled with 3.4+) | ||
| ^ | ||
| Alphanumeric method x is not declared infix; it should not be used as infix operator. | ||
| Instead, use method syntax .x(...) or backticked identifier `x`. | ||
| The latter can be rewritten automatically under -rewrite -source 3.4-migration. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
//> using options -Werror | ||
|
||
class Foo: | ||
def x(i: Int) = i | ||
infix def y(i: Int) = i | ||
|
||
def test(foo: Foo): Unit = | ||
foo x 1 // error (because it was compiled with 3.4+) | ||
foo y 2 // ok: is marked as infix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
tests/pos/alphanumeric-infix-operator-compat/A_1_c3.0.0.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class A: | ||
def x(i: Int) = i | ||
infix def y(i: Int) = i |
3 changes: 3 additions & 0 deletions
3
tests/pos/alphanumeric-infix-operator-compat/B_1_c3.1.0.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class B: | ||
def x(i: Int) = i | ||
infix def y(i: Int) = i |
3 changes: 3 additions & 0 deletions
3
tests/pos/alphanumeric-infix-operator-compat/C_1_c3.2.0.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class C: | ||
def x(i: Int) = i | ||
infix def y(i: Int) = i |
3 changes: 3 additions & 0 deletions
3
tests/pos/alphanumeric-infix-operator-compat/D_1_c3.3.0.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class D: | ||
def x(i: Int) = i | ||
infix def y(i: Int) = i |
15 changes: 15 additions & 0 deletions
15
tests/pos/alphanumeric-infix-operator-compat/Test3.4_2.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//> using options -Werror | ||
|
||
import language.`3.4` | ||
|
||
def test1(a: A, b: B, c: C, d: D): Unit = | ||
a x 1 // ok: was compiled with 3.0 | ||
b x 1 // ok: was compiled with 3.1 | ||
c x 1 // ok: was compiled with 3.2 | ||
d x 1 // ok: was compiled with 3.3 | ||
|
||
// ok: is marked as infix | ||
a y 2 | ||
b y 2 | ||
c y 2 | ||
d y 2 |
13 changes: 13 additions & 0 deletions
13
tests/pos/alphanumeric-infix-operator-compat/TestFuture_2.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import language.future | ||
|
||
def test2(a: A, b: B, c: C, d: D): Unit = | ||
a x 1 // ok: was compiled with 3.0 | ||
b x 1 // ok: was compiled with 3.1 | ||
c x 1 // ok: was compiled with 3.2 | ||
d x 1 // ok: was compiled with 3.3 | ||
|
||
// ok: is marked as infix | ||
a y 2 | ||
b y 2 | ||
c y 2 | ||
d y 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EugeneFlesselle here is the new version of the TASTy version. I changed a bit your original design, now we only have a TASTy version if the symbol vas loaded from TASTy. For symbols created from source we can assume they have the current TASTy version.