diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2013-08-31 21:44:34 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2013-10-04 10:12:48 +0200 |
commit | b747209b10793a88ce09f4b89d90dd4c50b05896 (patch) | |
tree | ebdd3bb2d011c62f056afb41a6d041078e7246a6 /src/compiler/scala/tools/nsc/typechecker/Typers.scala | |
parent | 90a312669b37d6e3e3f08685953ded24759e6102 (diff) | |
download | scala-b747209b10793a88ce09f4b89d90dd4c50b05896.tar.gz scala-b747209b10793a88ce09f4b89d90dd4c50b05896.tar.bz2 scala-b747209b10793a88ce09f4b89d90dd4c50b05896.zip |
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.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index ecd987b031..a169ba8302 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -4539,7 +4539,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper def sym = tree1.symbol if (tree.isInstanceOf[PostfixSelect]) checkFeature(tree.pos, PostfixOpsFeature, name.decode) - if (sym != null && sym.isOnlyRefinementMember) + if (sym != null && sym.isOnlyRefinementMember && !sym.isMacro) checkFeature(tree1.pos, ReflectiveCallsFeature, sym.toString) qualStableOrError.symbol match { |