D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6806 - struct TS(size_t){} instantiates in distinct types by `1` and `1u`
Summary: struct TS(size_t){} instantiates in distinct types by `1` and `1u`
Status: RESOLVED DUPLICATE of issue 3467
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2011-10-12 12:42 UTC by Denis Shelomovskii
Modified: 2015-06-09 05:11 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Denis Shelomovskii 2011-10-12 12:42:00 UTC
The main bug is:
---
struct TS(size_t n) { }
static assert(is(TS!(1u) == TS!(1)));
---
main.d(2): Error: static assert  (is(TS!(1u) == TS!(1))) is false

The second is a minor naming 2 only bug:
---
struct TS(size_t k) { }

TS!(n) get(size_t n)() { return TS!(n)(); }

void main()
{
    //get!(1)(); //uncomment to enable D2 only type naming bug
	
    // The next line produces `assert(is(TS!(@@@) == TS!(1))) is false` error
    // where @@@ is replaced by `1u` if `get` call is commented, and by `n` otherwise.
    static assert(is(TS!(1u) == TS!(1))); 
}
---
Comment 1 Kenji Hara 2011-10-13 23:04:32 UTC
This seems to be same as bug 3467.
Comment 2 Kenji Hara 2011-10-14 01:49:11 UTC

*** This issue has been marked as a duplicate of issue 3467 ***