Skip to content

StagedTuple changes #5822

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

Merged
merged 7 commits into from
Apr 15, 2019
Merged

StagedTuple changes #5822

merged 7 commits into from
Apr 15, 2019

Conversation

biboudis
Copy link
Contributor

@biboudis biboudis commented Jan 30, 2019

Restore previous unapply and homogenize staged method names. I used the convention of putting the *Staged at the end.

  • Decouple staged tuples from dynamic tuples
  • Add an explicit argument [Tail[Tup]] because tail (on a Tuple6) was failing even on master
  • Refactor direct usages of throw QuoteError

depends on #6210, checked with stageIt = true that it passes and reverted it back to false

@biboudis
Copy link
Contributor Author

biboudis commented Feb 28, 2019

Rebased

Note to self: an assertion error occurs after erasure when compiling tests/run/tuple-cons-2.scala.
It seems the following synthesised code raises an error:

.asInstanceOf[{
  type evidence$22$_~$15 = Int
  type evidence$21$_~$5 = (Int, Int)(Tuple_this)(Tuple_this)
  evidence$22$_~$15 *: evidence$21$_~$5
}]

instead it should have been (Int, Int, Int)

@biboudis biboudis force-pushed the fix-#5409 branch 3 times, most recently from 6ebd4e9 to fa7104a Compare March 12, 2019 13:39
@biboudis biboudis force-pushed the fix-#5409 branch 2 times, most recently from eeb986b to ecc5465 Compare April 2, 2019 12:46
@biboudis biboudis force-pushed the fix-#5409 branch 3 times, most recently from 189b16d to 85c6963 Compare April 4, 2019 11:14
@biboudis biboudis requested a review from nicolasstucki April 4, 2019 11:15
@biboudis biboudis assigned nicolasstucki and unassigned biboudis Apr 4, 2019
@@ -1,18 +1,22 @@
package scala
package scala.compiletime
Copy link
Contributor

Choose a reason for hiding this comment

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

We should move this to scala.internal

Copy link
Contributor Author

@biboudis biboudis Apr 9, 2019

Choose a reason for hiding this comment

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

I tried the change and I get an expected error 🤷‍♂️:

[info] Compiling 5 Scala sources to /Users/bibou/Projects/dotty/library/../out/bootstrap/dotty-library-bootstrapped/scala-0.14/classes ...
[error] -- Error: /Users/bibou/Projects/dotty/library/src-bootstrapped/scala/Tuple.scala:350:24 
[error] 350 |    if (Tuple.stageIt) (x.head, x.tail)
[error]     |                        ^^^^^^
[error]     |Could not find class scala.internal.StagedTuple$ in classpath. The most common reason for that is that you apply macros in the compilation run that defines them
[error]     | This location is in code that was inlined at Tuple.scala:224
[error]     | This location is in code that was inlined at Tuple.scala:350
[error] -- Error: /Users/bibou/Projects/dotty/library/src-bootstrapped/scala/internal/quoted/Matcher.scala:287:44 
[error] 287 |      case (Some(acc), Some(holes)) => Some(acc ++ holes)
[error]     |                                            ^^^^^^^^^^^^
[error]     |Could not find class scala.internal.StagedTuple$ in classpath. The most common reason for that is that you apply macros in the compilation run that defines them
[error]     | This location is in code that was inlined at Tuple.scala:66
[error]     | This location is in code that was inlined at Matcher.scala:287
[error] two errors found
[error] (dotty-library-bootstrapped / Compile / compileIncremental) Compilation failed
[error] Total time: 2 s, completed Apr 9, 2019 10:15:43 AM

@biboudis
Copy link
Contributor Author

Can I merge this @nicolasstucki ?

@nicolasstucki nicolasstucki merged commit 8e323b1 into scala:master Apr 15, 2019
@nicolasstucki nicolasstucki deleted the fix-#5409 branch April 15, 2019 12:48
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.

2 participants