diff options
author | Martin Odersky <odersky@gmail.com> | 2012-04-12 23:47:59 -0700 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2012-04-12 23:47:59 -0700 |
commit | 1c89ab72339fee8767869585f28811d5e2e437b1 (patch) | |
tree | c794d4b1d52af53beca4829c6ee159bd53d37af6 /src/compiler/scala/tools/nsc/typechecker/Typers.scala | |
parent | a7a1e3a1959f26c9b44b40b328ef217b4ebdbaba (diff) | |
download | scala-1c89ab72339fee8767869585f28811d5e2e437b1.tar.gz scala-1c89ab72339fee8767869585f28811d5e2e437b1.tar.bz2 scala-1c89ab72339fee8767869585f28811d5e2e437b1.zip |
Enabling postfix ops feature warning, and working on libs to avoid them.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 0233974f6f..b1cbc53044 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -750,7 +750,7 @@ trait Typers extends Modes with Adaptations with PatMatVirtualiser { if (!(currentRun.reportedFeature contains featureTrait)) raw += "\nThis can be achieved by adding the import clause 'import language." + featureName + "'\n" + "or by setting the compiler option -language:" + featureName + ".\n" + - "See the Scala docs for value scala.language." + featureName + "for a discussion\n" + + "See the Scala docs for value scala.language." + featureName + " for a discussion\n" + "why the feature " + req + " be explicitly enabled." currentRun.reportedFeature += featureTrait val msg = raw replace ("#", construct) @@ -805,7 +805,7 @@ trait Typers extends Modes with Adaptations with PatMatVirtualiser { protected def adapt(tree: Tree, mode: Int, pt: Type, original: Tree = EmptyTree): Tree = { def adaptToImplicitMethod(mt: MethodType): Tree = { - if (context.undetparams nonEmpty) { // (9) -- should revisit dropped condition `(mode & POLYmode) == 0` + if (context.undetparams.nonEmpty) { // (9) -- should revisit dropped condition `(mode & POLYmode) == 0` // dropped so that type args of implicit method are inferred even if polymorphic expressions are allowed // needed for implicits in 2.8 collection library -- maybe once #3346 is fixed, we can reinstate the condition? context.undetparams = inferExprInstance(tree, context.extractUndetparams(), pt, @@ -2157,7 +2157,7 @@ trait Typers extends Modes with Adaptations with PatMatVirtualiser { var body1: Tree = typed(cdef.body, pt) val contextWithTypeBounds = context.nextEnclosing(_.tree.isInstanceOf[CaseDef]) - if (contextWithTypeBounds.savedTypeBounds nonEmpty) { + if (contextWithTypeBounds.savedTypeBounds.nonEmpty) { body1.tpe = contextWithTypeBounds restoreTypeBounds body1.tpe // insert a cast if something typechecked under the GADT constraints, @@ -4188,7 +4188,7 @@ trait Typers extends Modes with Adaptations with PatMatVirtualiser { result match { // could checkAccessible (called by makeAccessible) potentially have skipped checking a type application in qual? - case SelectFromTypeTree(qual@TypeTree(), name) if qual.tpe.typeArgs nonEmpty => // TODO: somehow the new qual is not checked in refchecks + case SelectFromTypeTree(qual@TypeTree(), name) if qual.tpe.typeArgs.nonEmpty => // TODO: somehow the new qual is not checked in refchecks treeCopy.SelectFromTypeTree( result, (TypeTreeWithDeferredRefCheck(){ () => val tp = qual.tpe; val sym = tp.typeSymbolDirect @@ -4751,6 +4751,8 @@ trait Typers extends Modes with Adaptations with PatMatVirtualiser { else typedSelect(qual1, name) + if (tree.isInstanceOf[PostfixSelect]) + checkFeature(tree.pos, PostfixOpsFeature, name.decode) if (tree1.symbol != null && tree1.symbol.isOnlyRefinementMember) checkFeature(tree1.pos, ReflectiveCallsFeature, tree1.symbol.toString) |