Skip to content

Commit

Permalink
Fix generated code snippet for property traversal (#258)
Browse files Browse the repository at this point in the history
The code snippet generated with `FilterSteps#genericOption` results in an error
like the one below during compilation.

```
value || is not a member of Iterable[Long @uncheckedVariance]
```

Replacing `.empty` with `.isEmpty` should fix this.

Signed-off-by: ricekot <git@ricekot.com>
  • Loading branch information
ricekot authored Sep 26, 2024
1 parent 1c6bf43 commit ab93c28
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -397,14 +397,14 @@ object CodeSnippets {
| * Traverse to nodes where the $nameCamelCase does not equal the given `value`
| * */
|def ${nameCamelCase}Not(value: $baseType): Iterator[NodeType] =
| traversal.filter{node => node.$nameCamelCase.empty || node.$nameCamelCase.get != value}
| traversal.filter{node => node.$nameCamelCase.isEmpty || node.$nameCamelCase.get != value}
|
|/**
| * Traverse to nodes where the $nameCamelCase does not equal any one of the given `values`
| * */
|def ${nameCamelCase}Not(values: $baseType*): Iterator[NodeType] = {
| val vset = values.toSet
| traversal.filter{node => node.$nameCamelCase.empty || !vset.contains(node.$nameCamelCase.get)}
| traversal.filter{node => node.$nameCamelCase.isEmpty || !vset.contains(node.$nameCamelCase.get)}
|}
|""".stripMargin
}
Expand Down

0 comments on commit ab93c28

Please sign in to comment.