File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,8 @@ private[repl] class Rendering(parentClassLoader: Option[ClassLoader] = None):
114114 val objectName = sym.owner.fullName.encode.toString.stripSuffix(" $" )
115115 val resObj : Class [? ] = Class .forName(objectName, true , classLoader())
116116 val symValue = resObj
117- .getDeclaredMethods.find(_.getName == sym.name.encode.toString)
117+ .getDeclaredMethods
118+ .find(method => method.getName == sym.name.encode.toString && method.getParameterCount == 0 )
118119 .flatMap(result => rewrapValueClass(sym.info.classSymbol, result.invoke(null )))
119120 symValue
120121 .filter(_ => sym.is(Flags .Method ) || sym.info != defn.UnitType )
Original file line number Diff line number Diff line change 1+ scala> def o(s: String) = "o"; def oo(s: String) = "oo"; val o = "o"; val oo = "oo"
2+ def o(s: String): String
3+ def oo(s: String): String
4+ val o: String = o
5+ val oo: String = oo
You can’t perform that action at this time.
0 commit comments