Page 1 of 1

Generated code error

Posted: Tue Mar 07, 2023 2:12 am
by Jack Harich
Another error. I expect that during my learning Ventity phase, there will be plenty of these, so I really appreciate your patience!
Generated code at (577, 76) Cannot convert lambda expression to delegate type 'System.Func<string>' because some of the return types in the block are not implicitly convertible to the delegate return type (context: initializing; reference voter_by_politician_supported, in politician)
The model is very young and has hardly anything yet. The problem relates to a partitioned collection. Thanks!

Re: Generated code error

Posted: Tue Mar 07, 2023 3:37 pm
by tomfid
Not sure what the problem is, but it's not the referenced count. Ticketed - hopefully devs will have an answer soon.

Re: Generated code error

Posted: Tue Mar 07, 2023 6:19 pm
by tomfid
The error is defining the incumbent attribute as an integer 1 instead of a string "1". We'll catch this in the future.

Re: Generated code error

Posted: Tue Mar 07, 2023 10:58 pm
by tomfid
However, you wouldn't want to make the incumbent attribute "1" because there is no politician with that name. It should be "P1" or something to match your data. I tend to leave the attribute default expression blank and instead define it in the input data.