summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-07-18 08:41:38 -0700
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-07-18 08:41:38 -0700
commitc3b6d69939aa40412a1166647f95fcb9553e11e4 (patch)
treeadb3dfd65d0e87e3bc18f0d7cf944b42ec6b454a /src
parent019f0c6d81b6979754563ecbf62a846c99823110 (diff)
parent776105a43ef7a7a7c32be8111b496a6762a8ac68 (diff)
downloadscala-c3b6d69939aa40412a1166647f95fcb9553e11e4.tar.gz
scala-c3b6d69939aa40412a1166647f95fcb9553e11e4.tar.bz2
scala-c3b6d69939aa40412a1166647f95fcb9553e11e4.zip
Merge pull request #909 from lrytz/t5892
SI-5892 allow implicit views in annotation args
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Contexts.scala6
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala4
2 files changed, 8 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
index bcf529ecd2..805f60ba87 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
@@ -636,6 +636,12 @@ trait Contexts { self: Analyzer =>
collect(imp.tree.selectors)
}
+ /* SI-5892 / SI-4270: `implicitss` can return results which are not accessible at the
+ * point where implicit search is triggered. Example: implicits in (annotations of)
+ * class type parameters (SI-5892). The `context.owner` is the class symbol, therefore
+ * `implicitss` will return implicit conversions defined inside the class. These are
+ * filtered out later by `eligibleInfos` (SI-4270 / 9129cfe9), as they don't type-check.
+ */
def implicitss: List[List[ImplicitInfo]] = {
if (implicitsRunId != currentRunId) {
implicitsRunId = currentRunId
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index 48fd6ba928..dc9f07cad9 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -1214,8 +1214,8 @@ trait Namers extends MethodSynthesis {
if (!annotated.isInitialized) tree match {
case defn: MemberDef =>
val ainfos = defn.mods.annotations filterNot (_ eq null) map { ann =>
- // need to be lazy, #1782
- AnnotationInfo lazily (typer typedAnnotation ann)
+ // need to be lazy, #1782. beforeTyper to allow inferView in annotation args, SI-5892.
+ AnnotationInfo lazily beforeTyper(typer typedAnnotation ann)
}
if (ainfos.nonEmpty) {
annotated setAnnotations ainfos