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

Dscanner should allow opCmp with no toHash #575

Closed
JackStouffer opened this issue Mar 29, 2018 · 1 comment
Closed

Dscanner should allow opCmp with no toHash #575

JackStouffer opened this issue Mar 29, 2018 · 1 comment

Comments

@JackStouffer
Copy link

Consider

struct S
{
        int opCmp(S rhs)
        {
            assert(0);
        }
}

void main()
{
        assert(S.init == S.init);
}

The absence of opEquals means it's using the language default, which means it's safe for S to use the default toHash as well.

dscanner should only throw a warning when opEquals exists but toHash doesn't.

@ghost ghost added this to the 0.5.1 milestone Apr 1, 2018
@Hackerpilot
Copy link
Collaborator

I agree that this would be a good change.

@ghost ghost mentioned this issue Apr 5, 2018
wilzbach added a commit that referenced this issue Apr 5, 2018
fix #575 - Dscanner should allow opCmp with no toHash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants