Skip to content

Source spans lost in strategies when using property_test attribute macro #617

@zopsicle

Description

@zopsicle
[dev-dependencies.proptest]
version = "1.9.0"
features = ["attr-macro"]
#[property_test]
fn f(#[strategy = 1i32 .. 50i32] a: u32)
{
}
error[E0271]: type mismatch resolving `<RangeInclusive<i32> as Strategy>::Value == u32`
  --> example.rs:1:1
  |
1 |     #[property_test]
  |     ^^^^^^^^^^^^^^^^ expected `u32`, found `i32`
  |

The compiler diagnostic points at the property_test attribute, but should point to strategy or at least the parameter whose type is incorrect, otherwise it is not clear which of the parameters are ill-typed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions