summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@typesafe.com>2015-09-18 13:28:41 +0200
committerLukas Rytz <lukas.rytz@typesafe.com>2015-09-18 13:28:41 +0200
commita757be140c2a6cfb5464c28f8a4aaa764c095306 (patch)
tree0256c2d8e3d035ed9a3cb9c27d3083168f9e4db5
parent2c5cb7a2e8075d7eca0d47e2ceaf361c1cc82db8 (diff)
parent98fd36872277bb12fa9482efdd19171347a236dc (diff)
downloadscala-a757be140c2a6cfb5464c28f8a4aaa764c095306.tar.gz
scala-a757be140c2a6cfb5464c28f8a4aaa764c095306.tar.bz2
scala-a757be140c2a6cfb5464c28f8a4aaa764c095306.zip
Merge pull request #4699 from alexeyr/patch-1
Include owner in ErrorNonExistentField message
-rw-r--r--src/reflect/scala/reflect/runtime/JavaMirrors.scala6
-rw-r--r--test/files/run/reflection-fieldmirror-ctorparam.check6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/reflect/scala/reflect/runtime/JavaMirrors.scala b/src/reflect/scala/reflect/runtime/JavaMirrors.scala
index d0670f337a..50442519f2 100644
--- a/src/reflect/scala/reflect/runtime/JavaMirrors.scala
+++ b/src/reflect/scala/reflect/runtime/JavaMirrors.scala
@@ -124,9 +124,9 @@ private[scala] trait JavaMirrors extends internal.SymbolTable with api.JavaUnive
private def ErrorArrayConstructor(sym: Symbol, owner: Symbol) = abort(s"Cannot instantiate arrays with mirrors. Consider using `scala.reflect.ClassTag(<class of element>).newArray(<length>)` instead")
private def ErrorFree(member: Symbol, freeType: Symbol) = abort(s"cannot reflect ${member.kindString} ${member.name}, because it's a member of a weak type ${freeType.name}")
private def ErrorNonExistentField(sym: Symbol) = abort(
- sm"""Scala field ${sym.name} isn't represented as a Java field, neither it has a Java accessor method
- |note that private parameters of class constructors don't get mapped onto fields and/or accessors,
- |unless they are used outside of their declaring constructors.""")
+ sm"""Scala field ${sym.name} of ${sym.owner} isn't represented as a Java field, nor does it have a
+ |Java accessor method. One common reason for this is that it may be a private class parameter
+ |not used outside the primary constructor.""")
/** Helper functions for extracting typed values from a (Class[_], Any)
* representing an annotation argument.
diff --git a/test/files/run/reflection-fieldmirror-ctorparam.check b/test/files/run/reflection-fieldmirror-ctorparam.check
index e391e7ccfe..c66be94ed7 100644
--- a/test/files/run/reflection-fieldmirror-ctorparam.check
+++ b/test/files/run/reflection-fieldmirror-ctorparam.check
@@ -1,3 +1,3 @@
-class scala.ScalaReflectionException: Scala field x isn't represented as a Java field, neither it has a Java accessor method
-note that private parameters of class constructors don't get mapped onto fields and/or accessors,
-unless they are used outside of their declaring constructors.
+class scala.ScalaReflectionException: Scala field x of class A isn't represented as a Java field, nor does it have a
+Java accessor method. One common reason for this is that it may be a private class parameter
+not used outside the primary constructor.