-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression in std/sets: len used before its definition #17385
Comments
Sorry, it's not a regression but rather a change in the sets module I think. |
updated the example |
Since this seems to be |
Caused by #16959 |
|
@Yardanico I tried the original example you had reported before editing it to add furthermore:
for reference: # first.nim
type
HashSet*[T] = object
data: T
counter: int
iterator items*[T](s: HashSet[T]): int =
let length = s.len()
yield length
proc len*[T](hs: HashSet[T]): int =
result = hs.counter
# second.nim
import first
type
Other*[T] = object
data: T
proc test*[T](x: Other[T]) =
var test = HashSet[T]()
for x in test.items():
echo x
# third.nim
import second
var other = Other[int]()
other.test() |
@timotheecour well I specifically edited the example because it was a wrong one, see #17385 (comment) |
ok, that clarifies, thanks! ( |
The title might not be the most descriptive, but I have an example here. Found in https://github.com/mark-summerfield/diff (which uses
std/sets
)Example
Current Output
Expected Output
Successful compilation
Additional Information
Works in 1.4.4
The text was updated successfully, but these errors were encountered: