forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
anonymous functions are not macro dependencies
- Loading branch information
1 parent
99c19a7
commit 705f9d2
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//> using options -experimental -Yno-experimental | ||
|
||
import scala.annotation.{experimental, MacroAnnotation} | ||
import scala.quoted.* | ||
|
||
class ImplicitValue | ||
|
||
object ImplicitValue: | ||
inline given ImplicitValue = | ||
${ makeImplicitValue } | ||
|
||
def makeImplicitValue(using Quotes) = | ||
import quotes.reflect.* | ||
'{ ImplicitValue() } | ||
end ImplicitValue | ||
|
||
@experimental | ||
class Test extends MacroAnnotation: | ||
def transform(using Quotes)(tree: quotes.reflect.Definition) = | ||
import quotes.reflect.* | ||
Implicits.search(TypeRepr.of[ImplicitValue]) | ||
List(tree) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
//> using options -experimental -Yno-experimental | ||
|
||
class OuterClass: | ||
@Test | ||
class InnerClass | ||
|
||
@Test | ||
object InnerObject | ||
end OuterClass | ||
|
||
object OuterObject: | ||
@Test | ||
class InnerClass | ||
|
||
@Test | ||
object InnerObject | ||
end OuterObject |