Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.33 KB | None | 0 0
  1. // Classes didn't care but functions do IG? ... O_O
  2. // Re: https://pastebin.com/wzvwjvDg
  3.  
  4. scala> def foo = println("hi")
  5. foo: Unit
  6.  
  7. scala> foo
  8. hi
  9.  
  10. scala> foo()
  11.           ^
  12.        error: Unit does not take parameters
  13.  
  14. scala> def foo() = println("wait, what")
  15. foo: ()Unit
  16.  
  17. scala> foo()
  18. wait, what
  19.  
  20. scala> foo
  21. wait, what
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement