-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fixing #7140: Implementing new lazy vals scheme #14545
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
Closed
Closed
Changes from all commits
Commits
Show all changes
1248 commits
Select commit
Hold shift + click to select a range
54a9d0e
Change `-scala-release` flag into proper VersionSetting
Kordyjan 7b7498a
Add `since` annotation
Kordyjan e535c85
Add since annotations to all symbols added in 3.1
Kordyjan d03c327
Restrict scope of `since` annotation
Kordyjan 68017a3
Check for types with `since` annotation
Kordyjan 6e04111
wip
Kordyjan 99080ed
Finalize work on @since and -scala-release:
prolativ e99a524
Reworks for forward compat:
prolativ f88395d
Use a more portable way to download an old compiler for tests
prolativ 3104401
scala-release: Adjust MiMa filters; Revert changes to tasty module
prolativ b7276ee
-Yscala-release support: extend community build with basic forward-co…
prolativ 91fb1c5
-Yscala-release support: test cats-effect compiled with scala 3.0.2 w…
prolativ 0bf15e7
-Yscala-release support: Improve caching artifacts downloaded for tests
prolativ f72265d
-Yscala-release support: temporarily enable forward compat community …
prolativ c7f02ea
-Yscala-release support: checking if classes come from stdlib based o…
prolativ 59444de
-Yscala-release support: checking if classes come from stdlib based o…
prolativ b3facbd
-Yscala-release support: fix documentation; run extended CI only for …
prolativ ea48747
Add regression test
nicolasstucki a67f1df
Fix #7512: Normalize match type arguments
OlivierBlanvillain b181b8a
Parse splices inside patterns as patterns
adampauls 18309fc
PR comments.
adampauls 70ed013
Allow return in tailrec position
mbovel 3709750
Visit all trees
mbovel 06468db
Add compiletime benchmarks
mbovel 54c033d
Avoid creating set on each call
mbovel 1eedc4a
add -e <expression> eval to command line
philwalk 1edb47c
no source file created ; add more tests
philwalk 2cb2554
Split dotty.tests.filter by comma, to select multiple
dwijnand 170582b
Format compiler crash stack traces
dwijnand 7d6e65b
fixed byte code generation for expr types to include type parameters
gagandeepkalra a3f04b8
Fix vulnerable dependency
BarkingBad 114811f
Avoid cyclic error in checkNoModuleClash
dwijnand 643b1d1
Extract effectiveOwner
dwijnand 4a24edd
Fix type avoidance in nested Array case
dwijnand 9ac8226
Avoid weird Ranges of TypeBounds??
dwijnand 3ef2f2f
Improve typer traces
dwijnand 529e057
Scala 2.13.8 (was 2.13.6)
SethTisue d05f093
Don't lift try-catch statements that are already in local functions
KacperFKorban e362e22
Fix scalatest community-build
KacperFKorban cfe8654
Fix #12260: Add underscore to match type syntax
OlivierBlanvillain 3405682
Fix #9171: treat _ as _:Any in isMatchTypeShaped
OlivierBlanvillain 7ef5b51
Parse 'case _' as 'Ident(_)'
OlivierBlanvillain c809bcb
Printing hack for `case _ =>`
OlivierBlanvillain a5e41a7
Fix #13223: Disalow ? in match types pats/bodies
OlivierBlanvillain 39c2195
Also disalow unbound wildcard type in pattern expr
OlivierBlanvillain a938020
Update community build (scodec)
OlivierBlanvillain 36d94f3
Avoid misleading error message
odersky e24a40e
Extract GADT constraints from wildcard type arguments
dwijnand b0e0385
Fix test output
nicolasstucki 0f5ca2e
Don't retypecheck erroneous arguments when fixing function
odersky 8585213
Refine condition when to not typecheck again
odersky b224c4b
Further refine condition when not to typecheck again
odersky 9917672
Disable protoquill
odersky 8813755
Harden `hasInnerErrors` and fix tests
odersky 13e4d05
Revert "Disable protoquill"
odersky 71ea89f
Fix protoquill
nicolasstucki 6855da3
Treat synthetic apply of case class as new expression
liufengyun 9bc38a8
Fix outer selection
liufengyun 23cb950
Fix test: synthetic apply is now transparent
liufengyun c94d2d6
Lazily use synthetic apply
liufengyun c12044b
Fix outer for calling instantiate
liufengyun 3436ec7
Add assertion to make sure selection makes sense
liufengyun 06d7e87
Use extension method syntax
liufengyun 0d34788
REPL class loader is context class loader
som-snytt 3aeeba3
Prefer context functions for ReplTests
som-snytt 5d14ab7
Update Scala CLA url
xuwei-k 622310b
Update issue templates
anatoliykmetyuk 5408287
Output other compiler errors
nicolasstucki 176ecf5
Make errors from other compilers simpler to read
nicolasstucki 447ff08
Do not report warnings
nicolasstucki 3607de0
Do not harcode other compile -pagewidth
nicolasstucki f4758db
Properly report errors
nicolasstucki b45a421
Show broken source file errors
nicolasstucki 2a92e12
Change error message text from "fully-initialized" to "fully initiali…
Xavientois 101893f
Fix windows CI; use coursier as tests dependency; conditionally enabl…
prolativ e285014
suppress warning when compiling sbt bridge
SethTisue 30dd394
Decrease DelegatingReporter suppression zone
dwijnand de3294b
Update wording of uninitialized value error to be grammatically correct.
Xavientois 904a16f
tests: Allow "//scalac: args"
dwijnand 06d8e1a
tests: Read tool args in test files
dwijnand e620066
Add forward compat tests for macros
nicolasstucki de12bde
Add backwards compat tests for macros
nicolasstucki 2cdbb55
Add version of compat test that compiles on current version
nicolasstucki e965114
Disable tests/pos-macros/backwardCompat-3.1
nicolasstucki 4334dca
Remove #14306 test
nicolasstucki b4ee584
Reverse test naming backward/forward
nicolasstucki bb225d6
Fix #13855: Add regression test
OlivierBlanvillain 0fe4ded
Avoid unnecessary under-constrained implicit searches
smarter bf76b96
Fix #14240: Fix off-by-1 when emitting Scala.js IR Positions.
sjrd 7c21ea9
Move elim repeated earlier
odersky 73e0689
Update analyzer plugin
odersky d4c8765
Fix import in analyzer plugin
odersky 583b712
Trial: New ElimByName phase
odersky 01da866
Install the new ElimByName in place of ByNameClosures
odersky 545f4b7
Specialize byname functions
odersky 610fda2
Fix typos in comment
odersky fba3dbf
Make isSubArg symmetric again
odersky 50b9927
Reorganize RefChecks tasks
odersky 8dfcf54
Fix "have same type after erasure" check
odersky 8d9ed1c
Change versions after the release of 3.1.1
Kordyjan 4f7327a
Fix chat link in README
KacperFKorban eee261e
Fix approximating RefinedTypes (n>1)
dwijnand 3ff1fc2
Properly desugar `inline given .. with ..`
nicolasstucki 391c29a
Disallow `transparent inline given .. with ..`
nicolasstucki 6968ee1
Add documentation on inline given instances
nicolasstucki 9280bcf
Expand inline given instance docs
nicolasstucki dc7f13a
Add example
nicolasstucki 7753832
Parameter untupling is not a conversion of functions
som-snytt a92007c
Scala2Unpickler: Fix annotation argument handling
smarter a8c8a8a
Correctly handle context functions in scaladoc
KacperFKorban fc17123
addresses compile error mentioned in #14332
philwalk 269dae2
remove unused code; eliminate quotes in eval expression
philwalk c296385
remove unused code, cleanup old-style syntax, add main method to Expr…
philwalk 63c7fa2
Close Files.lines stream
nicolasstucki 2282b1d
Use `Using.resource`
nicolasstucki 37dae0f
Keep language imports around longer
odersky 7da757c
Make import contexts visible in macro transforms
odersky b7f063d
A version of transformStats that avoids stack overflows
odersky d1c32f2
Use a single "mapStatements" implementation in three places
odersky e93f515
Update experimental overview page
odersky 1b4a89d
Reorganize side bar and overview page
odersky fc885f9
Move explicit-nulls page to experimental section
odersky c5d2be7
refactor: improve output of -Xshow-phases
ckipp01 44aae2a
Fix - after cleanup run checkout to back to repo directory
lwronski 8073e52
Rename master branch to main in CI
anatoliykmetyuk bd6ce70
Rename master branch to main in scaladoc tasks
anatoliykmetyuk f745fa6
Rename master branch to main in benchmark profiles
anatoliykmetyuk e281a87
Rename master branch to main in the documentation
anatoliykmetyuk 106b0d8
Show inlined positions with source code
nicolasstucki a504e15
Keep softness when widening unions
mbovel 7e12ed5
Add special case to init checker to always allow certain methods
Xavientois 7262f10
fix #14393
rssh 064e46d
Update protoquill to latest build
deusaquilus 434fc6c
community build: update stdLib213 to current 2.13.x head
SethTisue 84eb162
Revert "Show inlined positions with source code"
smarter d020b9f
Scaladoc: Unescaped special characters in Quotes documentation
KacperFKorban 2d8e4a5
Add draft as regression tests
nicolasstucki bf18a57
Update higher-order-quoted-expressions.scala
nicolasstucki d39dbcf
Fix invariant quote type holes
dwijnand a989137
Revert "Revert "Show inlined positions with source code""
nicolasstucki 2316fc3
Check if source exists for inline positions
nicolasstucki 03abded
Re-enable missing cmdTests
nicolasstucki ebafbef
Comment out debug code
nicolasstucki 43d9e10
Port Scala 2 f-interpolator
som-snytt be59cfa
Cleanup dispatch to interpolations
som-snytt 96eed43
Brace reduction and remove dead code
som-snytt 9a2e42a
Simplify Conversion
som-snytt d92e36c
Simplify TypedFormatChecker
som-snytt c6eee0c
Drop special reporter
som-snytt 6ced168
Improve error position and recovery for bad dollar
som-snytt 84f3190
Pretty print type on f-interpolator, improve caret
som-snytt 2eb3942
Use normal string escaping for f
som-snytt 563241f
Collect error comments
som-snytt df5f0c0
Add doc page for capture checking.
odersky aec53c6
Revert eager use of escape in interpolator
som-snytt e546a7e
fix typos in capture checking doc page
olhotak 2ba981f
Infer parameters of eta applications with vararg parameters
odersky 51279e7
Drop invalid test
odersky 0868c9b
Update compiler/src/dotty/tools/dotc/typer/Typer.scala
odersky 922f9c0
For generic tuples, call Tuples.apply instead of _1/_2/..
dwijnand e2986a4
Capture checking doc page changes
odersky 214f8b4
Fix more typos in CC doc page
odersky 0ed6f11
Interactive: fix `contextOfPath` for Template
dos65 90f952f
Add regression test
nicolasstucki 5728066
Issue Tsardom role specification
anatoliykmetyuk c3c561d
Fix typo
anatoliykmetyuk 5504dbf
Tsardom role spec updated according to the Dotty meeting of 31/01/22
anatoliykmetyuk e1471b7
Maintenance list added
anatoliykmetyuk 146d50d
Fix typo
anatoliykmetyuk 2d69c2b
Fix typo
anatoliykmetyuk baa99ed
Make JVM backed maintenance more precise
anatoliykmetyuk 1e66185
Typo fix
anatoliykmetyuk 9426340
Typo fix
anatoliykmetyuk 9b85dc1
Typo fix
anatoliykmetyuk 2d4042c
Reword MAINTENANCE
anatoliykmetyuk f9a347c
Update MAINTENANCE.md
anatoliykmetyuk d9ef712
Improve -explain rendering
nicolasstucki 550f14a
Refactor static-site loading
pikinier20 ae65e83
Change static site directory structure. Adjust Dotty static site dire…
pikinier20 9e7e8a4
Refactor blog handling
pikinier20 ba8c55e
Adjust testcases static site to the new structure. Change assets copy…
pikinier20 8dae666
CRs from review. Add `hidden` property to hide page configured throug…
pikinier20 338e73d
Change requests: Uniformize property names in YAML config
pikinier20 0da41f6
Fix explain rendering with Windows EOL
mbovel b24de89
Fix backend assertion when using an exported enum
dwijnand 09f325d
Alternative fix based on tpd.desugarIdent
odersky bfb103b
Reposition assertion to respect safe initialization
Xavientois 4d41156
Fix safe-init error in MegaPhase
Xavientois 6d1a990
Scaladoc: Repair links
pikinier20 303d519
Document that inline methods are not eta expanded
odersky 35e5df6
Avoid using · character
mbovel 17653ec
Fix #11008: Support generic tuples as a valid unapply result
anatoliykmetyuk ab4c803
Support generic tuples as a valid unapplySeq return type
anatoliykmetyuk 09c2a6f
Add test for the generic tuples as result types of unapplySeq
anatoliykmetyuk d668013
Supress safe initialization warning in Run class
Xavientois bddcabe
Change default blog directory to 'blog'
pikinier20 0ff3a33
Make member filtering case-insensitive in scaladoc
jchyb 42025d6
Add id attributes to anchors of members in Scaladoc searchbar
jchyb 233ffe9
Close searchbar after clicking a result in Scaladoc
jchyb 3f7e688
Fix anchors in Inkuire results in Scaladoc
jchyb f4eaa2e
Add problematic test
Sporarum 22d86a4
Fix dependent function types rendering
pikinier20 198f716
Add dependent function type testcase
pikinier20 fa565b9
Follow renames in content contributors script
pikinier20 5a1e828
Avoid stale import context during REPL parsing
griggt e1b2bdd
fix typo in docs example capability checking
bjornregnell c73ed36
Set zero span for synthetic enum import selector
tgodzik 4a9f226
Propagate unreported features when flushing a reporter
odersky ba33e98
Fix what -Xlint should have reported if it existed
odersky 7040145
Create errorTermTrees for more missing arguments to Apply nodes.
adampauls 8690b61
Disable type simplify in unpickler
noti0na1 4b3287f
Rename test file
noti0na1 09e19d3
Search all source trees for a given span
tgodzik 3aa1438
Tweak `pathTo` comment in NavigateAST
tgodzik 816b1ad
Set zero span for synthetic tuple type
tgodzik 0afcd76
Find inline calls inserted in synthetic members
nicolasstucki 19fb504
Set proper position for ValDefs generated from tuples
tgodzik 79f6ed9
Remove unnecessary newScope in newNormalizedClassSymbol
nicolasstucki a654314
Don't compute indents when in a string
som-snytt 0217581
Fix space in unsafe nulls
noti0na1 98a0372
Add patman test
noti0na1 282d0f3
Fix tests in Ycheck
noti0na1 b6f6e81
Remove StickyKey
noti0na1 9cbc1fa
Relax overriding by stripping nulls deeply
noti0na1 4f346b4
move widenDealias
noti0na1 49c9b39
Testing new approach
noti0na1 6ef149c
Add comments
noti0na1 4d6668a
Fix typos
noti0na1 a82dcda
Add restriction
noti0na1 9b58d19
Move relaxed context to a function
noti0na1 1253563
fix(#11202): explicitly handle TypeTree in syntax highlighting
ckipp01 b7ea842
Better positions on errorTermTree
adampauls 618d3e7
Thread context through block in transforms correctly and efficiently
odersky 55f9808
Fix "forward reference from self constructor" checking
odersky 105036d
Protected case class constructor -> private apply
dwijnand 60fe22f
Set context when reporting summonInline errors
andrzejressel 0133a3e
fix(parser): make empty catch an incomplete.
ckipp01 69ede37
Don't skip override tests when overridden is AbsOverride
odersky 5bb036c
Introduce generation config for Scaladoc
pikinier20 6c8f21d
Add task generating Scala 3 language reference
pikinier20 bdbc32e
Edit unused imports
som-snytt d0bd3ba
Remove unused definitions
nicolasstucki 76a1495
Implementing lazy vals
olsdavis 20b5f0f
Reorder to avoid type erasure to Object issue + fix test
olsdavis 6f1a43e
Keeping code for old release compatibility
olsdavis e4b37ba
Fix conflicts
olsdavis e9deb26
Merge branch 'main' into master
olsdavis 6337421
fix null type
olsdavis 8aa44a8
Merge branch 'master' of github.com:olsdavis/dotty
olsdavis ceb27ff
fix nn for union type
olsdavis 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 hidden or 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
296 changes: 272 additions & 24 deletions
296
compiler/src/dotty/tools/dotc/transform/LazyVals.scala
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -1,7 +1,11 @@ | ||
-- Error: tests/init/neg/promotion-loop.scala:16:10 -------------------------------------------------------------------- | ||
16 | println(b) // error | ||
| ^ | ||
<<<<<<< HEAD | ||
| Cannot prove that the value is fully-initialized. Only initialized values may be used as arguments. | ||
======= | ||
| Cannot prove that the value is fully initialized. Only initialized values may be used as arguments. | ||
>>>>>>> 91c03b1f7835d574290eba1ecf236e0f59fc2bf0 | ||
| | ||
| The unsafe promotion may cause the following problem: | ||
| Cannot prove that the value is fully initialized. Only initialized values may be used as arguments. |
This file contains hidden or 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 hidden or 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,4 @@ | ||
computing x | ||
x | ||
computing y | ||
y |
This file contains hidden or 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 @@ | ||
// Compiled with 3.0.0 and run with current compiler | ||
class Foo: | ||
lazy val x = | ||
println("computing x") | ||
"x" | ||
lazy val y = | ||
println("computing y") | ||
"y" | ||
|
||
@main def Test = | ||
val foo = new Foo | ||
println(foo.x) | ||
println(foo.y) |
This file contains hidden or 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,4 @@ | ||
computing x | ||
x | ||
computing y | ||
y |
This file contains hidden or 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 @@ | ||
// Compiled with 3.1.0 and run with current compiler | ||
class Foo: | ||
lazy val x = | ||
println("computing x") | ||
"x" | ||
lazy val y = | ||
println("computing y") | ||
"y" | ||
|
||
@main def Test = | ||
val foo = new Foo | ||
println(foo.x) | ||
println(foo.y) |
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.
All new definitions in this class should be added to
project/MiMaFilters.scala
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.
This can be tested with