digitalmars.D.bugs - [Issue 16685] New: [The D Bug Tracker]
- via Digitalmars-d-bugs (27/27) Nov 14 2016 https://issues.dlang.org/show_bug.cgi?id=16685
https://issues.dlang.org/show_bug.cgi?id=16685 Issue ID: 16685 Summary: [The D Bug Tracker] Product: D Version: D2 Hardware: All URL: http://dlang.org/ OS: All Status: NEW Severity: enhancement Priority: P3 Component: dmd Assignee: nobody puremagic.com Reporter: eyal.lotem gmail.com Failing to instantiate a template from a correctly-typed compile-time value: struct Id { ushort value; } enum Id x = Id(5); struct S(ushort A) {} // This works, as expected: enum ushort someShortVal = 5; alias CanCreateFromShort = S!(someShortVal); // This works, as expected: alias CanCreateFromTypedValue = S!(ushort(x.value)); static assert(is(typeof(x.value) == ushort)); // This surprisingly fails alias CannotCreateFromValue = S!(x.value); --
Nov 14 2016