From db300d4d9e3eb1de4245ad3aeb686eb5302ae152 Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Sat, 31 Aug 2013 21:44:34 +0200 Subject: [backport] no longer warns on calls to vampire macros As eloquently elaborated and cleverly named by Travis Brown, macros defined in structural types are useful: http://meta.plasm.us/posts/2013/07/12/vampire-methods-for-structural-types/. However, since such macros are on the intersection of a number of language features, as usual, there are bugs. This commit fixes an unwanted interaction of macros defined in structural types with the scala.language.reflectiveCalls guard. Since macro calls aren't going to be carried to runtime, there's no need to warn about them. --- src/compiler/scala/tools/nsc/typechecker/Typers.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index e09a509839..8153766784 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -4934,7 +4934,7 @@ trait Typers extends Modes with Adaptations with Tags { if (tree.isInstanceOf[PostfixSelect]) checkFeature(tree.pos, PostfixOpsFeature, name.decode) - if (tree1.symbol != null && tree1.symbol.isOnlyRefinementMember) + if (tree1.symbol != null && tree1.symbol.isOnlyRefinementMember && !tree1.symbol.isMacro) checkFeature(tree1.pos, ReflectiveCallsFeature, tree1.symbol.toString) if (qual1.hasSymbolWhich(_.isRootPackage)) treeCopy.Ident(tree1, name) -- cgit v1.2.3