0

When I define a function inside the Scala REPL, I can see the created function's type, like this:

scala> def testing(a: Int) = a + 1
testing: (a: Int)Int

How can I see the function testing: (a:Int)Int when I'm not in REPL? Say, I want to know a function type a library uses at runtime so I can use the same type.

Thanks before.

om-nom-nom
  • 62,329
  • 13
  • 183
  • 228
bertzzie
  • 3,558
  • 5
  • 30
  • 41
  • Make sure that you know the differences between methods and functions in Scala: http://stackoverflow.com/questions/2529184/difference-between-method-and-function-in-scala – Malte Schwerhoff Aug 12 '12 at 13:42
  • not sure I understand the question, what are you trying to achieve? Broadly speaking, I think the Scala IDE in Eclipse and IntelliJ Scala plugin have most of these development assistances ... – aishwarya Aug 12 '12 at 14:36
  • @aishwarya I think what he is trying to do is to get this information via reflection as a string e.g. *get class name -> get functions -> get signatures*. – om-nom-nom Aug 12 '12 at 14:50
  • @aishwarya yes, just like om-nom-nom said. – bertzzie Aug 13 '12 at 01:37
  • @mhs thank you. I'll read that page and then see if I can improve this question... – bertzzie Aug 13 '12 at 01:37

0 Answers0