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

Fix bootstrap 3 #1

Closed
wants to merge 1,734 commits into from
Closed

Fix bootstrap 3 #1

wants to merge 1,734 commits into from

Conversation

odersky
Copy link

@odersky odersky commented May 21, 2016

More changes to TreeUnpickler

sjrd and others added 30 commits March 16, 2016 12:25
First steps towards rewriting from Scala2 in dotty
Implement most of the Scala.js IR code generator.
fix command line processing error
This broke under the recent introduction of the JS backend, because now
the context needs to be initialized before the platform can be selected.
So invoking `doti` immediately gave an IllegalStateException.

No big deal to fix, but it shows how sorely we are lacking REPL tests.
They printed as raw trees which confused the REPL
when wrapping subsequent liens with them.
It messed up parsing of multi-line strings and did not
seem to have a purpose. Error messages print fine without it.
It's used only in Resident, where it should be defined.
Central config class replaces mixture of parameters and fields.
The fields were in part in the wrong class, where they could not
easily be overridden.
This allows to remove the ugly workaround for default methods.
There is also a slight adaptation for the new way to encode a
reference to the JS global scope in the IR.
The standard syntax in Dotty now is `xs : _*`. In Scala2 mode,
following code should be valid:

    list match {
      case List(_, _, _, _ @ _*)     =>   0
      case List(_, _, _*)            =>   1
      case List(_, _: _*)            =>   2
      case Nil                       =>   3
    }
…without whitespace

Format of some of the compiler settings was incompatible with scalac. For example "-target:jvm-1.8" is a valid argument for scalac, but it should be "-target: jvm-1.8" (with a whitespace) for dotc.
support `xs @ _*` and `_*` in Scala2 mode
The error should be at the beginning of the underscore `_`,
not the next token after the star `*`, which is the default.
Rewriting did not go far enough, as evidenced by pos/i1174.scala

Fixes scala#1174
Fix problem involving classtag based pattern matches.
better positioning of `_*` not last argument error
dotc settings: String options after settings with colon shouldn't be ignored
Improvements & bugs that were discovered while implementing specialization.
Simplified logic and now check prefixes of TypeRefs.
Without the simplified logic we would get false cyclic errors for ski.scala.

Test case: flowops.scala

Fixes scala#1185.
The previous formulation broke for named parameters.
Test case in flowops1.scala.
vcInlineMethods could produce a different type on rewire which led to a -Ycheck failure. We now insert
a cast when that happens.

Test case: pos/flowops1.scala with -Ycheck:vcInline.
odersky added 17 commits May 19, 2016 17:15
Unrelated to other commits but useful to get in.
When reading Tasty we need to pre-set the info of a class to some
ClassInfoType with (as yet) unknown parents and self type. But for
module classes, we need to know the source module at all time, and this
gets determined by the self type. So we now produce a TermRef
for the assumed self type of a module class.
It caused an assertion error when separately compiling
parts of dotty against TASTY information. Not sure the
test achieves anything or whether it produces a false
negative.
Instrument Denotations#current to find CyclicReference errors
arising during transforms.
Forcing it led to CyclicReferences involving RefChecks.OptLevelInfo when compiling
dotc/*.scala against Tasty files. The problem was that when transforming OptLevelInfo
the backend forced a transformInfo of RefChecks in TypeErasure which filtered RefCheck's
scope to eliminate non-class type definitions. Without the tweak in this commit this
tried to make all symbols current, and so came back to OptLevelInfo.
We had a problem where unpickling an annotation containing a
class constant had the wrong type. Unpickling was done after erasure.
The type given to the constant was an alias but aliases got
eliminated during erasure, so the constant was malformed.
Unpickling annotation contents at the same phase as unpickling
the annotation carrier solves the problem.

It seems similar problems can arise when data is unpickled
using a LocalUnpickler. So we now make sure local unpickling
runs at the latest at phase Pickler.
Do this in the inferred (result-)type of ValDefs and DefDefs.
Without this fix, TreeTraverser#traverseChildren in Trees.scala
gets a result type of BoxedUnit (but only when co-compiled from
source, not when unpickled).
It's possible that the given phase argument does not exist, in which case
we do not want to set the current phase to NoPhase.
Trying the dotc bootstrap revealed that Frozen logic can lead
to assertion errors. So we want to remove it, but then taking
fingerprints would no longer be cost-effective.

Note: In local checking removing fingerprinting did cost some
performance: junit test time went from 590s to 604s. We should watch
the checkin benchmarks to see whether this gets confirmed.
The selective dotc bootstrap has shown that we cannot always
establish the invariants required by the previous scheme of
memberNames cache validation, which was based on the Frozen flag.
Therefore, Frozen gets dropped and we use a generation nunber
based scheme with a scan of base classes instead.
Compute initialization flags of possibly enclosing traits
elsewhere (in indexStats). Cleans up the logic and makes
the module more understandable.
First step for a more robust scheme to access symbols in Tasty.
This entailed a swap of two fields in RefiendType, to make tree
format more uniform in what concerns where references are found.
Instead of stubbing with potentially wrong owners and hping for the best, we
now compute owners on demand, using the lazy data structure of an OwnerTree.
Include member defs inside templates in the enclosing class,
otherwise they would get localDummy as onwer.
@odersky odersky closed this May 23, 2016
@odersky odersky deleted the fix-bootstrap-3 branch May 23, 2016 09:28
smarter added a commit that referenced this pull request Jun 4, 2016
Add support for incremental compilation
tgodzik pushed a commit to tgodzik/dotty that referenced this pull request Mar 8, 2019
…alac-integration-tests

Add scalac and dotty compilers
odersky pushed a commit that referenced this pull request Oct 16, 2020
* Use new links 

Right now, there are multiple features with links that just say "The contents of this page have moved." It'd be more convenient if the links directly went to the updated pages.

* Delete implicit-function-types-spec.md

* Delete implicit-function-types.md

* Delete delegates.md

* Delete given-clauses.md

* Update features-classification.md
odersky pushed a commit that referenced this pull request Oct 16, 2020
Remove deprecated docs and links to them (#1)
smarter pushed a commit that referenced this pull request Feb 23, 2021
1. set $scala_exit_status & trap onExit; script exit code correct whether called via scalac or java -jar
2. added missing 'scala -version' option to via call to 'scalac -version'
3. extended and verified REPL and scripting for Cygwin, MinGW, Msys2, and Windows shells with a cygpath tool
4. MinGW based Windows shell environments require TERM=dumb to support REPL
5. simpify and extend jar manifest classpath to support for changing default drive
6. tested for the following Windows and Linux environments:
7. added tests

  CYGWIN_NT-10.0 host 3.1.7(0.340/5/3) 2020-08-22 17:48 x86_64 Cygwin
  MINGW64_NT-10.0-19042 host 3.1.7-340.x86_64 2020-10-23 13:08 UTC x86_64 Msys
  MSYS_NT-10.0-19042 host 3.1.7-340.x86_64 2020-11-08 12:32 UTC x86_64 Msys
  Linux host 5.4.0-62-generic scala#70~18.04.1-Ubuntu SMP Tue Jan 12 17:18:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
  Linux host 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Manual test results for executing a script via compile mode and then java -jar mode:

uname -a :: CYGWIN_NT-10.0 d5 3.1.7(0.340/5/3) 2020-08-22 17:48 x86_64 Cygwin

uname -a :: Linux quadd 5.4.0-62-generic scala#70~18.04.1-Ubuntu SMP Tue Jan 12 17:18:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

uname -a :: Linux d5 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

uname -a :: MINGW64_NT-10.0-19042 d5 3.1.7-340.x86_64 2020-10-23 13:08 UTC x86_64 Msys

uname -a :: MSYS_NT-10.0-19042 d5 3.1.7-340.x86_64 2020-11-08 12:32 UTC x86_64 Msys

uname -a :: CYGWIN_NT-10.0 d5 3.1.7(0.340/5/3) 2020-08-22 17:48 x86_64 Cygwin
odersky added a commit that referenced this pull request Mar 16, 2023
bishabosha pushed a commit that referenced this pull request Apr 28, 2023
odersky added a commit that referenced this pull request Dec 18, 2023
`given ... with` or `given ... = new { ... }` kinds of definitions now follow
the old rules. This allows recursive `given...with` definitions as they are
found in protoQuill.

We still have the old check in a later phase against directly recursive methods.
Of the three loops in the original i15474 we now detect #2 and #3 with new new
restrictions. #1 slips through since it is a loop involving a `given...with` instance
of `Conversion`, but is caught later with the recursive method check.

Previously tests #1 and #3 were detected with the recursive methods check and #2 slipped
through altogether.

The new rules are enough for defining simple givens with `=` without fear of looping.
odersky added a commit that referenced this pull request Dec 18, 2023
`given ... with` or `given ... = new { ... }` kinds of definitions now follow
the old rules. This allows recursive `given...with` definitions as they are
found in protoQuill.

We still have the old check in a later phase against directly recursive methods.
Of the three loops in the original i15474 we now detect #2 and #3 with new new
restrictions. #1 slips through since it is a loop involving a `given...with` instance
of `Conversion`, but is caught later with the recursive method check.

Previously tests #1 and #3 were detected with the recursive methods check and #2 slipped
through altogether.

The new rules are enough for defining simple givens with `=` without fear of looping.
odersky added a commit that referenced this pull request Jan 6, 2024
`given ... with` or `given ... = new { ... }` kinds of definitions now follow
the old rules. This allows recursive `given...with` definitions as they are
found in protoQuill.

We still have the old check in a later phase against directly recursive methods.
Of the three loops in the original i15474 we now detect #2 and #3 with new new
restrictions. #1 slips through since it is a loop involving a `given...with` instance
of `Conversion`, but is caught later with the recursive method check.

Previously tests #1 and #3 were detected with the recursive methods check and #2 slipped
through altogether.

The new rules are enough for defining simple givens with `=` without fear of looping.
Kordyjan pushed a commit that referenced this pull request May 23, 2024
`given ... with` or `given ... = new { ... }` kinds of definitions now follow
the old rules. This allows recursive `given...with` definitions as they are
found in protoQuill.

We still have the old check in a later phase against directly recursive methods.
Of the three loops in the original i15474 we now detect #2 and #3 with new new
restrictions. #1 slips through since it is a loop involving a `given...with` instance
of `Conversion`, but is caught later with the recursive method check.

Previously tests #1 and #3 were detected with the recursive methods check and #2 slipped
through altogether.

The new rules are enough for defining simple givens with `=` without fear of looping.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
9 participants