D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 15111 - hashOf fails for structs that have an alias this to a dynamic array
Summary: hashOf fails for structs that have an alias this to a dynamic array
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-24 15:55 UTC by IdanArye
Modified: 2020-03-21 03:56 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description IdanArye 2015-09-24 15:55:59 UTC
$ dmd --version
DMD64 D Compiler v2.068
Copyright (c) 1999-2015 by Digital Mars written by Walter Bright
$ cat app.d 
import core.internal.hash;

struct Foo {
    int[] arr;
    alias arr this;
}

void main() {
    Foo().hashOf();
}
$ dmd app.d 
app.d(9): Error: core.internal.hash.hashOf called with argument types (Foo) matches both:
/usr/include/dlang/dmd/core/internal/hash.d(40):     core.internal.hash.hashOf!(Foo).hashOf(Foo val, ulong seed)
and:
/usr/include/dlang/dmd/core/internal/hash.d(112):     core.internal.hash.hashOf!(Foo).hashOf(Foo val, ulong seed)
/usr/include/dlang/dmd/object.d(2999): Error: core.internal.hash.hashOf called with argument types (Foo, ulong) matches both:
/usr/include/dlang/dmd/core/internal/hash.d(40):     core.internal.hash.hashOf!(Foo).hashOf(ref Foo val, ulong seed)
and:
/usr/include/dlang/dmd/core/internal/hash.d(112):     core.internal.hash.hashOf!(Foo).hashOf(ref Foo val, ulong seed)
app.d(9): Error: template instance object.hashOf!(Foo) error instantiating
Comment 1 github-bugzilla 2016-04-26 19:14:36 UTC
Commits pushed to master at https://github.com/dlang/druntime

https://github.com/dlang/druntime/commit/3af285fea29e7bbe2bea9b4fcb4b93f1ecb72755
fix issue 15111 - hashOf fails for structs that have an alias this to a dynamic array

https://github.com/dlang/druntime/commit/2d8b0a5901bde46d3f773ad1a22cd3780306067c
Merge pull request #1536 from BBasile/issue-15111

fix issue 15111 - hashOf fails for structs that have an alias this to a dynamic array
Comment 2 github-bugzilla 2016-10-01 11:44:39 UTC
Commits pushed to stable at https://github.com/dlang/druntime

https://github.com/dlang/druntime/commit/3af285fea29e7bbe2bea9b4fcb4b93f1ecb72755
fix issue 15111 - hashOf fails for structs that have an alias this to a dynamic array

https://github.com/dlang/druntime/commit/2d8b0a5901bde46d3f773ad1a22cd3780306067c
Merge pull request #1536 from BBasile/issue-15111
Comment 3 github-bugzilla 2018-01-05 13:27:31 UTC
Commits pushed to dmd-cxx at https://github.com/dlang/druntime

https://github.com/dlang/druntime/commit/3af285fea29e7bbe2bea9b4fcb4b93f1ecb72755
fix issue 15111 - hashOf fails for structs that have an alias this to a dynamic array

https://github.com/dlang/druntime/commit/2d8b0a5901bde46d3f773ad1a22cd3780306067c
Merge pull request #1536 from BBasile/issue-15111