Skip to content

Add match types mixed with staged macro #5065

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
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
486074a
Add Tuple and *: types
odersky Aug 13, 2018
386b5e1
Add version-specific source directories in the library
smarter Aug 14, 2018
9bd796a
Fix Inlined abbreviation in erased code
odersky Aug 14, 2018
b0f7680
Remove rewrite annotation again
odersky Aug 14, 2018
c455db1
Add generative operations to tuples
odersky Aug 14, 2018
7d474da
Fix TupleXXL equals
odersky Aug 14, 2018
492f80e
More generative operations on Tuples: tail, apply, ++
odersky Aug 14, 2018
eac7792
Erase *: to tuple classes
odersky Aug 14, 2018
e353af9
Allow tuple literals to extend beyond 22
odersky Aug 15, 2018
4ad41d4
Don't generate *: in generic Java signatures
odersky Aug 15, 2018
fadd4b7
Test pattern matching of tuples >= 23.
odersky Aug 16, 2018
d786b4c
Whitelist some Scala-2 classes as pure
odersky Aug 17, 2018
f09ba1b
Fix side-effect handling in reduceProjection
odersky Aug 17, 2018
3bfea78
Support a limited form of rewrite unapplys
odersky Aug 17, 2018
98971a6
Enforce implementation restrictions
odersky Aug 17, 2018
93d5eac
Add MatchType as a type form
odersky Aug 20, 2018
e830298
Represent literals used as types with SingletonTypeTrees
odersky Aug 20, 2018
f5d96a5
Syntax, parsing, and type-checking of match types
odersky Aug 20, 2018
0326709
Fix unpickling of match types
odersky Aug 20, 2018
033e701
Blacklist match type fromtasty test
odersky Aug 20, 2018
fdcbc9f
Classify type defs with matches as RHS as abstract
odersky Aug 22, 2018
04124a9
Implement subtyping for match types
odersky Aug 22, 2018
d17c292
Cache match reduce results
odersky Aug 22, 2018
5bdee62
Cache results of attempts to reduce match types
odersky Aug 23, 2018
1fd37a3
Use a special type for match aliases
odersky Aug 24, 2018
e881350
Applications of erased functions are always pure
odersky Aug 24, 2018
2710e2b
Allow user-defined error diagnostics when rewriting
odersky Aug 24, 2018
a1efa25
Fix two issues when comparing match types
odersky Aug 24, 2018
dc7f447
MatchType reorg
odersky Aug 27, 2018
a19e2cc
Typelevel natural numbers
odersky Aug 27, 2018
a345e9e
Reduce matches on creation
odersky Aug 27, 2018
d34e3fa
Handle MatchTypeTrees in ExtractAPI
odersky Aug 29, 2018
825db1b
Refine matchtype reduction caching
odersky Aug 29, 2018
da4b5e8
Coarser variance checking for match types
odersky Aug 29, 2018
fbb173f
Add constValue function
odersky Aug 29, 2018
e1a2e61
Add NonEmptyTuple abstract class
odersky Aug 29, 2018
1a31183
More precise derivesFrom for MatchTypes
odersky Aug 29, 2018
0f5e82b
Base Tuple computations on types
odersky Aug 29, 2018
8daf613
Make MatchTypes value types
odersky Aug 29, 2018
97e0f3b
Fix inlining of parameters of singleton type
odersky Aug 29, 2018
5284fe8
Test tuples2 needs to run with -Yno-deep-subtypes
odersky Aug 29, 2018
86e17fb
Add constValueOpt method
odersky Aug 29, 2018
5c2a105
Fix unpickling of match type aliases
odersky Aug 29, 2018
2e9cd7d
Survive bottom values in pattern matches
odersky Aug 29, 2018
d34c45e
Report rewrite errors at outermost rewrite call
odersky Aug 29, 2018
39b86e3
Harden Tuple operations against wrong inputs
odersky Aug 29, 2018
dd0d0eb
Reduce sizes of tuples of tuples2.scala
odersky Aug 29, 2018
e583c9c
Experiment with type matches and staged macros
nicolasstucki Aug 30, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bench/src/main/scala/Benchmarks.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ object Bench {

val opts = new OptionsBuilder()
.shouldFailOnError(true)
.jvmArgs("-Xms2G", "-Xmx2G")
.jvmArgs("-Xms2G", "-Xmx2G", "-Xss10m")
.mode(Mode.AverageTime)
.timeUnit(TimeUnit.MILLISECONDS)
.warmupIterations(warmup)
Expand Down
3 changes: 2 additions & 1 deletion compiler/src/dotty/tools/dotc/transform/ReifyQuotes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,9 @@ class ReifyQuotes extends MacroTransformWithImplicits {
*/
def levelOK(sym: Symbol)(implicit ctx: Context): Boolean = levelOf.get(sym) match {
case Some(l) =>
// FIXME: types should be allowd access at level -1
l == level ||
level == -1 && sym == defn.TastyTasty_macroContext
level == -1 //&& (sym.isType || sym == defn.TastyTasty_macroContext)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this quick fix may make some tests fail

case None =>
!sym.is(Param) || levelOK(sym.owner)
}
Expand Down
Loading