File tree 2 files changed +7
-1
lines changed
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):
114
114
val objectName = sym.owner.fullName.encode.toString.stripSuffix(" $" )
115
115
val resObj : Class [? ] = Class .forName(objectName, true , classLoader())
116
116
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 )
118
119
.flatMap(result => rewrapValueClass(sym.info.classSymbol, result.invoke(null )))
119
120
symValue
120
121
.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