Open SemanticBeeng opened 5 years ago
@SemanticBeeng Hi. Could you pls post source file that causes the error?
Ok, DM exchanged showed that the problem is with methods shaped the following way (with an empty param list:
def status(): F[Unit)
Quick workaround is to remove the parens. I'll try to tune the macro to handle this case properly.
@SemanticBeeng Could you please alter the ticket title (I can't)?
Vladimir advised the macro crash is due to the empty parameter list in def status() :
below.
Fixed to make it like def expiresIn :
def expiresIn: F[com.kse.shared.domain.TimeMs]
def keepAlive(period: com.kse.shared.domain.TimeMs): F[Unit]
def status(): F[domain.SessionStatus]
def terminate(reason: String): F[Unit]
}
Will keep it open to fix this rough edge of the macro. Many thanks.
Actually I’d rather forbid empty params list methods at all :) They are used to mark something impure, which should not be a case.
I would be perfectly okay to close, ofc. A nicer error message would have helped but not sure if the job of the macro is to be aware of event sourced entity design style.
It's more about code-style that communicates purity. Aecor calls itself opinionated
, so I see no problem with a readable, opinionated error-message.
A nice error message would be great.
@notxcain I am getting this as soon as I add a method in my event sourced entity api returning
*Status
. The*Status
is implemented similar toBookingStatus
from @vpavkin 's tutorial.The only thing I can see different is that my
*Status
is in a different sbt module than the entity. But also tried moving it to same sbt module and getting sameAny idea of what might cause this? Not likely this to be an
aecor
bug but maybe others will run into it so worth having it here.