score:2

I think that this is the similar to the issue that I'm running into.

First, ScalaSigreader#42

if (current == null)

should be

if (current == classOf[java.lang.Object])

Then, you'll get a more helpful error message: "Can't find field b from Foo". But this by itself doesn't fix the issue.

I haven't looked into a fix for the private field issue. However, I do have a fix for the issue with the interface. For that problem, ScalaSigReader#45 needs to be modified.

Currently if the field isn't found then the superclass is searched:

findField(findClass(current), name).getOrElse(read(current.getSuperclass))

The interfaces must be searched as well:

findField(current, name)
    .orElse(current.getInterfaces.flatMap(findField(_, name)).headOption)
    .getOrElse(read(current.getSuperclass))

private def findField(clazz: Class[_], name: String): Option[MethodSymbol] =
    findField(findClass(clazz), name)

See also:

Issue #403

Pull #436


Related Query

More Query from same tag