Skip to content

misleading error message: "no matching operator for the parameters type" when the real issue is the return type #1048

@namasikanam

Description

@namasikanam
require import AllCore FSet List.

op choose (s : int fset) : int fset =
  List.filter (fun (i : int) => i \in s) [1;2;3].

Hi, when I try the following definition, I got the error message below.

no matching operator, named `List.filter', for the following parameters' type:
  [1]: int -> bool
  [2]: int list

However, the real issue here is the resulting type of the required operation is a int fset while List.filter returns int list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions