Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
the scanner is now less eager about deprecations
When healing braces it isn't very useful to report deprecation warnings, especially since this process is just simple context-free skimming, which can't know about what positions can accept what identifiers. Backport from #1807. Original commit is e5d34d7.
- Loading branch information
Showing
4 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Impls_Macros_1.scala:5: error: illegal start of simple expression | ||
} | ||
^ | ||
one error found |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-language:experimental.macros |
15 changes: 15 additions & 0 deletions
15
test/files/neg/macro-false-deprecation-warning/Impls_Macros_1.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import scala.reflect.macros.Context | ||
|
||
object Helper { | ||
def unapplySeq[T](x: List[T]): Option[Seq[T]] = | ||
} | ||
|
||
object Macros { | ||
def impl[T: c.WeakTypeTag](c: Context)(x: c.Expr[List[T]]) = { | ||
c.universe.reify(Helper.unapplySeq(x.splice)) | ||
} | ||
|
||
object UnapplyMacro { | ||
def unapplySeq[T](x: List[T]): Option[Seq[T]] = macro impl[T] | ||
} | ||
} |