Rule filter

Since about snapshot #1228 I get for

val x0 = rs1.members.filter[s|s.state == 0].size

Invalid number of arguments. The method filter(Iterable, Function1<? super T, Boolean>) is not applicable for the arguments (Set)


2018-03-17 21:40:45.399 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘tmp.rules’ has errors, therefore ignoring it: [11,32]: mismatched character ‘|’ expecting ‘]’
[11,47]: mismatched input ‘]’ expecting ‘end’
[13,32]: mismatched character ‘|’ expecting ‘]’

What’s to do?

1 Like

Jusst a guess: Add spaces between [ and ]

val x0 = rs1.members.filter[ s | s.state == 0 ].size

Thanks, that was very quick and easy.

After updating yesterday to build 1231, I get similar errors. That change get all my rules running again.

Thanks Udo

Why this change was done in the rule engine?

I’m pretty sure that this was not on purpose. Maybe a side effect of unit support, as units have to be set through [] either (but as always: just a guess).

This definitely needs to be addressed in the release notes and possibly the docs before 2.3 release. It is a breaking change and will hot a lot of people unexpectedly.

1 Like

I do not want to take credits for this… :wink: