-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
In Elixir 1.20.0-rc.1.
Feel free to close since it seems fixed on the latest StreamData (1.1.3+), but reporting just in case it is the symptom of an error message that could be improved.
Reproduction as a standalone script:
Mix.install([stream_data: "1.1.2"])
ExUnit.start()
defmodule ReproTest do
use ExUnit.Case, async: true
use ExUnitProperties
property "causes a type violation" do
check all(
int1 <- positive_integer(),
int2 <- positive_integer(),
sum = int1 + int2
) do
assert sum > int1
assert sum > int2
end
end
end warning: this clause in cond will always match:
sum = int1 + int2
since it has type:
dynamic(float() or integer())
where "int1" was given the type:
# type: dynamic(float() or integer())
# from: scripts/stream_data_check_all.exs:12:24
int1 + int2
where "int2" was given the type:
# type: dynamic(float() or integer())
# from: scripts/stream_data_check_all.exs:12:24
int1 + int2
where "sum" was given the type:
# type: dynamic(float() or integer())
# from: scripts/stream_data_check_all.exs:12:17
sum = int1 + int2
typing violation found at:
│
12 │ sum = int1 + int2
│ ~~~~~~~~~~~~~~~~~
│
└─ scripts/stream_data_check_all.exs:12: ReproTest."property causes a type violation"/1I can understand why a number would always match in a cond if that's the code being generated, but reporting a "typing violation" in the sum feels really confusing here.
Will try to come up with a minimal repro if I can.
Metadata
Metadata
Assignees
Labels
No labels