Skip to content

Strange behavior when adding code after forall #215

@pallix

Description

@pallix

I encountered this strange behaviour today. Given the following code:


    property "some property" do
      forall i <- integer() do
        IO.inspect(i, label: "i")
        test_some_property()
      end
    end

    property "some other property" do
      forall i <- integer() do
        IO.inspect(i, label: "ii")
        test_some_property()
      end
      test_some_other_property()
    end

    defp test_some_property do
      true
    end

    defp test_some_other_property do
      true
    end

only the code block with the label: i with be executed. Obviously it makes little sense to have test_some_other_property() after the forall but given my code was more complex than the example it took me a while to find the problem.

Is that the expected behaviour? Would it make sense to give a warning or error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions