Skip to content

Path dependent types level checking false negatives #8100

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
nicolasstucki opened this issue Jan 27, 2020 · 0 comments · Fixed by #12540
Closed

Path dependent types level checking false negatives #8100

nicolasstucki opened this issue Jan 27, 2020 · 0 comments · Fixed by #12540
Assignees
Milestone

Comments

@nicolasstucki
Copy link
Contributor

nicolasstucki commented Jan 27, 2020

minimized code

import scala.quoted._

class M {
  type E
}

def f[T: Type](using Quotes) =
  Expr.summon[M] match
    case Some('{ $mm : tt }) =>
      '{
        val m = $mm
        type ME = m.E
        ${ g[ME](using Type.of[ME]) }
        ${ g[m.E](using Type.of[ME]) }
        ${ g[ME](using Type.of[m.E]) }
        ${ g[m.E](using Type.of[m.E]) }
        ${ g[ME] }
        ${ g[m.E] }
      }

def g[T](using Type[T]) = ???

Has false negatives when checking the level of m in the types.

Compilation output
-- Error: Foo.scala:16:13 ------------------------------------------------------
16 |        ${ g[m.E](given '[ME]) }
   |             ^
   |             access to value m from wrong staging level:
   |              - the definition is at level 1,
   |              - but the access is at level 0.
-- Error: Foo.scala:18:13 ------------------------------------------------------
18 |        ${ g[m.E](given '[m.E]) }
   |             ^
   |             access to value m from wrong staging level:
   |              - the definition is at level 1,
   |              - but the access is at level 0.
-- Error: Foo.scala:19:16 ------------------------------------------------------
19 |        ${ g[ME] }
   |                ^
   |       access to type E from wrong staging level:
   |        - the definition is at level 0,
   |        - but the access is at level 1.
   |
   |        The access would be accepted with a given scala.quoted.Type[m.E]
-- Error: Foo.scala:20:13 ------------------------------------------------------
20 |        ${ g[m.E] }
   |             ^
   |             access to value m from wrong staging level:
   |              - the definition is at level 1,
   |              - but the access is at level 0.

expectation

They should all compile and be equivalent

@nicolasstucki nicolasstucki self-assigned this Jan 27, 2020
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jan 28, 2020
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jan 28, 2020
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Feb 3, 2020
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Feb 7, 2020
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Apr 29, 2020
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Apr 29, 2020
Fix scala#6140, fix scala#6772, fix scala#7030, fix scala#7892, fix scala#7997, fix scala#8651 and improve scala#8100.

Differences with previous implementation
* Only track and check levels within quotes or splices
* Track levels of all symbols not at level 0
* Split level checking into specialized variants for types and terms (healType/healTermType)
* Detect inconsistent types rather than try to detect consistent ones
* Check/heal term inconsistencies only on leaf nodes (TypeTree, RefTree, Ident, This)
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue May 4, 2020
Fix scala#6140, fix scala#6772, fix scala#7030, fix scala#7892, fix scala#7997, fix scala#8651 and improve scala#8100.

Differences with previous implementation
* Only track and check levels within quotes or splices
* Track levels of all symbols not at level 0
* Split level checking into specialized variants for types and terms (healType/healTermType)
* Detect inconsistent types rather than try to detect consistent ones
* Check/heal term inconsistencies only on leaf nodes (TypeTree, RefTree, Ident, This)
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jun 19, 2020
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue May 12, 2021
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue May 12, 2021
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue May 18, 2021
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue May 20, 2021
Split cross quote reference handling from pickling

Fixes scala#8100
Fixes scala#12443
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue May 20, 2021
Split cross quote reference handling from pickling

Fixes scala#8100
Fixes scala#12440
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue May 20, 2021
Split cross quote reference handling from pickling

Fixes scala#8100
Fixes scala#12440
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue May 20, 2021
Split cross quote reference handling from pickling

Fixes scala#8100
Fixes scala#12440
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue May 20, 2021
Split cross quote reference handling from pickling

Fixes scala#8100
Fixes scala#12440
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue May 21, 2021
Split cross quote reference handling from pickling

Fixes scala#8100
Fixes scala#12440
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue May 21, 2021
Split cross quote reference handling from pickling

Fixes scala#8100
Fixes scala#12440
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue May 21, 2021
Split cross quote reference handling from pickling

Fixes scala#8100
Fixes scala#12440
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jun 3, 2021
Split cross quote reference handling from pickling

Fixes scala#8100
Fixes scala#12440
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jun 9, 2021
Split cross quote reference handling from pickling

Fixes scala#8100
Fixes scala#12440
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jun 10, 2021
Split cross quote reference handling from pickling

Fixes scala#8100
Fixes scala#12440
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jun 10, 2021
Split cross quote reference handling from pickling

Fixes scala#8100
Fixes scala#12440
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 17, 2021
Split cross quote reference handling from pickling

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 18, 2021
Split cross quote reference handling from pickling

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 23, 2021
Split cross quote reference handling from pickling

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 24, 2021
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleType`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 24, 2021
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleType`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 24, 2021
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleType`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 29, 2021
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleType`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 30, 2021
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleType`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Dec 1, 2021
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleType`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Dec 15, 2021
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleTypeV2`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.
The `unpickleTypeV2` is just a version of `unpickleType` that does not
take the `termHole` parameter which is always `null`.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jan 3, 2022
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleTypeV2`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.
The `unpickleTypeV2` is just a version of `unpickleType` that does not
take the `termHole` parameter which is always `null`.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jan 4, 2022
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleTypeV2`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.
The `unpickleTypeV2` is just a version of `unpickleType` that does not
take the `termHole` parameter which is always `null`.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jan 13, 2022
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleTypeV2`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.
The `unpickleTypeV2` is just a version of `unpickleType` that does not
take the `termHole` parameter which is always `null`.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jan 19, 2022
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleTypeV2`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.
The `unpickleTypeV2` is just a version of `unpickleType` that does not
take the `termHole` parameter which is always `null`.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jan 20, 2022
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleTypeV2`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.
The `unpickleTypeV2` is just a version of `unpickleType` that does not
take the `termHole` parameter which is always `null`.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jan 20, 2022
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleTypeV2`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.
The `unpickleTypeV2` is just a version of `unpickleType` that does not
take the `termHole` parameter which is always `null`.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jan 21, 2022
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleTypeV2`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.
The `unpickleTypeV2` is just a version of `unpickleType` that does not
take the `termHole` parameter which is always `null`.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Feb 2, 2022
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleTypeV2`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.
The `unpickleTypeV2` is just a version of `unpickleType` that does not
take the `termHole` parameter which is always `null`.
With `-Yscala-relese` 3.0 or 3.1, the compiler will generate calls to
the old `unpickleExpr`/`unpickleType`.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563

Support -Yscala-relese macros

Disable tests/pos-macros/backwardCompat-3.0

Fix issue with captured types at level 0
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Feb 4, 2022
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleTypeV2`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.
The `unpickleTypeV2` is just a version of `unpickleType` that does not
take the `termHole` parameter which is always `null`.
With `-Yscala-relese` 3.0 or 3.1, the compiler will generate calls to
the old `unpickleExpr`/`unpickleType`.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563

Support -Yscala-relese macros

Disable tests/pos-macros/backwardCompat-3.0

Fix issue with captured types at level 0
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Feb 28, 2022
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleTypeV2`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.
The `unpickleTypeV2` is just a version of `unpickleType` that does not
take the `termHole` parameter which is always `null`.
With `-Yscala-relese` 3.0 or 3.1, the compiler will generate calls to
the old `unpickleExpr`/`unpickleType`.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
Fixes scala#14337
Fixes scala#14373
Closes scala#13732
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Mar 4, 2022
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleTypeV2`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.
The `unpickleTypeV2` is just a version of `unpickleType` that does not
take the `termHole` parameter which is always `null`.
With `-Yscala-relese` 3.0 or 3.1, the compiler will generate calls to
the old `unpickleExpr`/`unpickleType`.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
Fixes scala#14337
Fixes scala#14373
Closes scala#13732
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Mar 14, 2022
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleTypeV2`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.
The `unpickleTypeV2` is just a version of `unpickleType` that does not
take the `termHole` parameter which is always `null`.
With `-Yscala-relese` 3.0 or 3.1, the compiler will generate calls to
the old `unpickleExpr`/`unpickleType`.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
Fixes scala#14337
Fixes scala#14373
Closes scala#13732
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Mar 24, 2022
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleTypeV2`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.
The `unpickleTypeV2` is just a version of `unpickleType` that does not
take the `termHole` parameter which is always `null`.
With `-Yscala-relese` 3.0 or 3.1, the compiler will generate calls to
the old `unpickleExpr`/`unpickleType`.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
Fixes scala#14337
Fixes scala#14373
Closes scala#13732
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Apr 11, 2022
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleTypeV2`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.
The `unpickleTypeV2` is just a version of `unpickleType` that does not
take the `termHole` parameter which is always `null`.
With `-Yscala-relese` 3.0 or 3.1, the compiler will generate calls to
the old `unpickleExpr`/`unpickleType`.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
Fixes scala#14337
Fixes scala#14373
Closes scala#13732
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Apr 19, 2022
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleTypeV2`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.
The `unpickleTypeV2` is just a version of `unpickleType` that does not
take the `termHole` parameter which is always `null`.
With `-Yscala-relese` 3.0 or 3.1, the compiler will generate calls to
the old `unpickleExpr`/`unpickleType`.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
Fixes scala#14337
Fixes scala#14373
Closes scala#13732
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Apr 19, 2022
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleTypeV2`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.
The `unpickleTypeV2` is just a version of `unpickleType` that does not
take the `termHole` parameter which is always `null`.
With `-Yscala-relese` 3.0 or 3.1, the compiler will generate calls to
the old `unpickleExpr`/`unpickleType`.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
Fixes scala#14337
Fixes scala#14373
Closes scala#13732
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Apr 19, 2022
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleTypeV2`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.
The `unpickleTypeV2` is just a version of `unpickleType` that does not
take the `termHole` parameter which is always `null`.
With `-Yscala-relese` 3.0 or 3.1, the compiler will generate calls to
the old `unpickleExpr`/`unpickleType`.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
Fixes scala#14337
Fixes scala#14373
Closes scala#13732
michelou pushed a commit to michelou/scala3 that referenced this issue Apr 25, 2022
Separate the logic that creates holes in quotes from the logic that
pickles the quotes. Holes are created in the `Splicer` phase and the
result of the transformation can be `-Ycheck`ed. Now, the `PickleQuotes`
phase only needs to extract the contents of the holes, pickle the quote
and put them into a call to `unpickleExprV2`/`unpickleTypeV2`.

We add `unpickleExprV2` to support some optimization in the encoding of
the pickled quote. Namely we removed an unnecessary lambda from the
arguments of the hole passed into the contents of the hole. By not
changing `unpickleExpr` the current compiler will be able to handle the
old encoding in binaries compiled with older compilers.
The `unpickleTypeV2` is just a version of `unpickleType` that does not
take the `termHole` parameter which is always `null`.
With `-Yscala-relese` 3.0 or 3.1, the compiler will generate calls to
the old `unpickleExpr`/`unpickleType`.

Fixes scala#8100
Fixes scala#12440
Fixes scala#13563
Fixes scala#14337
Fixes scala#14373
Closes scala#13732
@Kordyjan Kordyjan added this to the 3.2.0 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants