File tree Expand file tree Collapse file tree 2 files changed +47
-8
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +47
-8
lines changed Original file line number Diff line number Diff line change @@ -5343,14 +5343,11 @@ object Types {
5343
5343
def isExpandingBounds : Boolean = expandingBounds
5344
5344
5345
5345
protected def expandBounds (tp : TypeBounds ): Type =
5346
- if expandingBounds then tp
5347
- else {
5348
- val saved = expandingBounds
5349
- expandingBounds = true
5350
- val res = range(atVariance(- variance)(reapply(tp.lo)), reapply(tp.hi))
5351
- expandingBounds = saved
5352
- res
5353
- }
5346
+ val saved = expandingBounds
5347
+ expandingBounds = true
5348
+ val res = range(atVariance(- variance)(reapply(tp.lo)), reapply(tp.hi))
5349
+ expandingBounds = saved
5350
+ res
5354
5351
5355
5352
/** Try to widen a named type to its info relative to given prefix `pre`, where possible.
5356
5353
* The possible cases are listed inline in the code.
Original file line number Diff line number Diff line change
1
+ package example
2
+
3
+ import scala .language .experimental .macros
4
+
5
+ trait Context {
6
+
7
+ val universe : Universe
8
+
9
+ trait Universe {
10
+ type Tree >: Null <: AnyRef with TreeApi
11
+ type Literal >: Null <: LiteralApi with TermTree
12
+ type TermTree >: Null <: TermTreeApi with Tree
13
+
14
+ trait TermTreeApi extends TreeApi { this : TermTree => }
15
+ trait LiteralApi extends TermTreeApi { this : Literal => }
16
+ trait TreeApi extends Product { this : Tree => }
17
+ }
18
+ }
19
+
20
+ object MacroCompat {
21
+
22
+ object Bundles {
23
+ def mono : Int = macro Macros2 .MacroImpl .mono
24
+ inline def mono : Int = $ { Macros3 .monoImpl }
25
+ }
26
+
27
+ object Macros2 {
28
+ class MacroImpl (val c : Context ) {
29
+ import c .universe ._
30
+
31
+ def mono : Literal = ???
32
+ }
33
+ }
34
+
35
+ object Macros3 {
36
+ import quoted ._
37
+
38
+ def monoImpl (using Quotes ) = ' {1 }
39
+
40
+ }
41
+
42
+ }
You can’t perform that action at this time.
0 commit comments