KacperFKorban / GUInep

Automatic UI forms for Scala 3 functions
https://kacperfkorban.github.io/GUInep/
Apache License 2.0
14 stars 0 forks source link

Fix no args #25

Closed KacperFKorban closed 5 months ago

KacperFKorban commented 5 months ago

Add support for no arg functions and functions with empty param lists.

e.g.

def roll20: Int =
  scala.util.Random.nextInt(20) + 1

def roll6(): Int =
  scala.util.Random.nextInt(6) + 1

@main
def run: Unit =
  guinep.web(
    roll20,
    roll6() // roll6 has to have parentheses here since otherwise it gives an error before inlining (might be unintentional in dotty)
  )