Skip to content

Nature filter & map elem type #563

Open
@antonmedv

Description

@antonmedv

filter & map returns []any type. In nature we can keep actual type and implement nature.Elem() method to get correct underlying type.

Those type checker error cases should be able to pass:

map(Any, {0})[0] + "str"
invalid operation: + (mismatched types int and string) (1:18)
 | map(Any, {0})[0] + "str"
 | .................^

map(filter(ArrayOfFoo, {true}), {.Not})
type mock.Foo has no field Not (1:35)
 | map(filter(ArrayOfFoo, {true}), {.Not})
 | ..................................^

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions