diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2007-06-09 17:00:37 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2007-06-09 17:00:37 +0000 |
commit | d4cc633ec978a0a6e04e11c2d6d8425e2d3b3725 (patch) | |
tree | d4dfc570e0d8fa11f15ee2ae6c4bcc019a1ae975 /src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | |
parent | 8414ebada9615aac0e8b436e7bdbeee5986ccaa3 (diff) | |
download | scala-d4cc633ec978a0a6e04e11c2d6d8425e2d3b3725.tar.gz scala-d4cc633ec978a0a6e04e11c2d6d8425e2d3b3725.tar.bz2 scala-d4cc633ec978a0a6e04e11c2d6d8425e2d3b3725.zip |
Added patch to allow definition of native metho...
Added patch to allow definition of native methods in Scala (contribution
from Stepan Koltsov)
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/RefChecks.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index c81e28a398..f178590a42 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -692,6 +692,11 @@ abstract class RefChecks extends InfoTransform { validateVariance(sym, sym.info, CoVariance) validateVariance(sym, sym.typeOfThis, CoVariance) + case DefDef(mods, name, tparams, vparams, tpt, EmptyTree) if tree.symbol.hasAttribute(definitions.NativeAttr.tpe) => + tree.symbol.resetFlag(DEFERRED) + result = transform(copy.DefDef(tree, mods, name, tparams, vparams, tpt, + typed(Apply(gen.mkAttributedRef(definitions.Predef_error), List(Literal("native method stub")))))) + case DefDef(_, _, _, _, _, _) => validateVariance(sym, sym.tpe, CoVariance) //@M TODO: might be affected by change in tpe --> can't use tree.tpe though checkDeprecatedOvers() |