This page is no longer maintained — Please continue to the home page at www.scala-lang.org

AST distinction between parameter-less and empty-parameter-list methods

No replies
Sciss
Joined: 2008-12-17,
User offline. Last seen 28 weeks 5 days ago.

hi,

how can i distinguish def x from def x() in an AST construction?

this:

DefDef(
NoMods withPosition (Flags.METHOD, NoPosition),
"x"
Nil, // tparams
Nil, // vparams
TypeTree( NoType ),
EmptyTree // rhs
)

produces def x ... but how do i get the def x()? i tried to use List( Nil ) in place of vparams, but that doesn't change anything it seems.

thanks, -sciss-

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland