File tree Expand file tree Collapse file tree 4 files changed +18
-1
lines changed
src/compiler/scala/tools/nsc/typechecker Expand file tree Collapse file tree 4 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -3078,7 +3078,7 @@ trait Typers extends Modes with Adaptations with Tags {
3078
3078
3079
3079
def checkNotMacro () = {
3080
3080
if (fun.symbol != null && fun.symbol.filter(sym => sym != null && sym.isTermMacro && ! sym.isErroneous) != NoSymbol )
3081
- duplErrorTree(NamedAndDefaultArgumentsNotSupportedForMacros (tree, fun))
3081
+ tryTupleApply getOrElse duplErrorTree(NamedAndDefaultArgumentsNotSupportedForMacros (tree, fun))
3082
3082
}
3083
3083
3084
3084
if (mt.isErroneous) duplErrTree
Original file line number Diff line number Diff line change
1
+ ()
Original file line number Diff line number Diff line change
1
+ import language .experimental .macros
2
+ import scala .reflect .macros .Context
3
+
4
+ object Demo {
5
+ def id [T ](a : T ): T = macro idImpl[T ]
6
+
7
+ def idImpl [T : c.WeakTypeTag ](c : Context )(a : c.Expr [T ]): c.Expr [T ] = a
8
+ }
Original file line number Diff line number Diff line change
1
+ // Macro usage:
2
+
3
+ object Test {
4
+ def main (args : Array [String ]) {
5
+ val s = Demo id ()
6
+ println(s)
7
+ }
8
+ }
You can’t perform that action at this time.
0 commit comments