Skip to content
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

Should fails when trying to compare std.container.array Ranges. #90

Open
sybrandy opened this issue May 6, 2020 · 2 comments
Open

Should fails when trying to compare std.container.array Ranges. #90

sybrandy opened this issue May 6, 2020 · 2 comments

Comments

@sybrandy
Copy link

sybrandy commented May 6, 2020

Morning,
It looks like Arrays (std.container.array) data types will cause test to not compile because the destructor is marked with @System. The error message looks similar to this:

@safe function ...should cannot call @system destructor std.container.array.Range(Array!string).RangeT.~this

Not sure what the correct solution is since there was an effort to make the code safe, but this is a valid range construct, so technically it should be supported. I personally have found the ability to compare ranges very useful since it provides diffs and therefore I personally would prefer it support all ranges.

@gedaiu
Copy link
Owner

gedaiu commented May 6, 2020

It looks like it is a bug... All ranges should be supported. I will look over and see how this can be fixed. Maybe this can be easily fixed by making the assert function @trusted.

@sybrandy
Copy link
Author

sybrandy commented May 6, 2020

If I may suggest, perhaps it would be good to create tests to ensure that the asserts work for all of the built-in containers (std.container.*)? Or, at least a sufficient set. I know std.container.dlist works, but there's nothing that states that any of the other ones aren't going to cause issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants