why won't withParams take a list of PARAMs?

13 views
Skip to first unread message

Jon Ross

unread,
Jun 29, 2018, 3:58:56 PM6/29/18
to treehugger-scala

This works :

(CASECLASSDEF("Works") withParams( PARAM( "one","Int"), PARAM("two","Int"), PARAM("three","Int") ) )

This doesn't compile :

(CASECLASSDEF("NoCompile") withParams( List("one","two","three").map( PARAM(_,"Int") ) ) )

it says it can't be applied to a List[ValNameStart]. I don't even know what a ValNameStart is... so maybe that's my problem.

But whatever it is, it seems like this should work, no? Everything else I've encountered so far seems happy to take a list of whatever it normally expects....

Thanks,

-Jon



Jon Ross

unread,
Jun 29, 2018, 4:12:04 PM6/29/18
to treehugger-scala

adding :ValDef makes it work :

(CASECLASSDEF("YesCompile") withParams( List("one","two","three").map( PARAM(_,"Int"):ValDef ) ) )

But I don't understand why....
Reply all
Reply to author
Forward
0 new messages