You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When seeing if I could make reasonable use of rstest for time, I quickly ran into an issue. If a case parameter is the same as the function name, compilation will fail. For example,
This fails because next is both a case parameter and the function name, and it is ambiguous in the expansion:
#[cfg(test)]fnnext(day:Weekday,next:Weekday){assert_eq!(day.next(),next);}#[cfg(test)]mod next {usesuper::*;#[test]fncase_1(){let day = Sunday;let next = Monday;next(day, next)}}
However, if next(day, next) is instead super::next(day, next), compilation would succeed. Given that the module is generated by rstest, we know that this path is always correct. Would it be possible to add this prefix to support the edge case?
Thanks for maintaining this crate!
The text was updated successfully, but these errors were encountered:
Yeah!!! Good point! I never thought about it. I'll fix it as soon as possible but I'm quite slow at the moment ... I've no too much time to spend on rstest in this period 😢
If you can submit a PR I'll really appreciate it 😄
When seeing if I could make reasonable use of
rstest
fortime
, I quickly ran into an issue. If a case parameter is the same as the function name, compilation will fail. For example,This fails because
next
is both a case parameter and the function name, and it is ambiguous in the expansion:However, if
next(day, next)
is insteadsuper::next(day, next)
, compilation would succeed. Given that the module is generated byrstest
, we know that this path is always correct. Would it be possible to add this prefix to support the edge case?Thanks for maintaining this crate!
The text was updated successfully, but these errors were encountered: