[Issue 16495] __traits(fullyQualifedName) instead of std.traits.fullyQualifiedName

2023-01-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16495

Dlang Bot  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from Dlang Bot  ---
dlang/dmd pull request #14711 "fix Issue 16495 - __traits(fullyQualifedName)
instead of std.traits.f…" was merged into master:

- 4dc346fc31d69326c9c7d780c57c92c3a7fa9efe by Walter Bright:
  fix Issue 16495 - __traits(fullyQualifedName) instead of
std.traits.fullyQualifiedName

https://github.com/dlang/dmd/pull/14711

--


[Issue 23635] Nonsensical "`case` must be a `string` or an integral constant, not `x`"

2023-01-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23635

Dlang Bot  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Dlang Bot  ---
dlang/dmd pull request #14840 "Fix Issue 23635 - Nonsensical "`case` must be a
`string` or an integr…" was merged into master:

- e1938d27555ca034b6eaa10be827fedce1031b81 by Nick Treleaven:
  Fix Issue 23635 - Nonsensical "`case` must be a `string` or an integral
constant, not `x`"

https://github.com/dlang/dmd/pull/14840

--


[Issue 23646] New: A nastier forward reference bug

2023-01-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23646

  Issue ID: 23646
   Summary: A nastier forward reference bug
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Keywords: rejects-valid
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: maxsamu...@gmail.com

alias aliases(a...) = a;

alias Components = Dependencies!Top;

template Dependencies(alias Component)
{
alias Dependencies = aliases!(Top.DirectDependencies);
// alias Dependencies = Top.DirectDependencies; // but this succeeds
}

struct Top
{
alias DirectDependencies = aliases!();
enum l = Components.length;
}


Error: template instance `onlineapp.Dependencies!(Top)` error instantiating

Moving `Components` last makes the code compile.

--


[Issue 23598] Circular reference bug with static if and eponymous templates

2023-01-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23598

Max Samukha  changed:

   What|Removed |Added

   See Also||https://issues.dlang.org/sh
   ||ow_bug.cgi?id=23646

--


[Issue 11051] Unmatched case in a final switch should throw in both release and non-release mode

2023-01-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11051

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #12 from Dlang Bot  ---
@ntrel created dlang/dmd pull request #14841 "Fix issue 11051" fixing this
issue:

- Fix issue 11051

  Keep a HALT instruction in a final switch statement if
  the function is @safe and -release mode is enabled.

https://github.com/dlang/dmd/pull/14841

--


[Issue 14643] Safety violation with final switch and void initializer

2023-01-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14643

Nick Treleaven  changed:

   What|Removed |Added

   See Also||https://issues.dlang.org/sh
   ||ow_bug.cgi?id=11051

--


[Issue 14643] Safety violation with final switch and void initializer

2023-01-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14643

--- Comment #3 from Nick Treleaven  ---
> the bug might not even be reproducible

Oops, the original bug also violates safety anyway. The above comment combined
with the original example means that any enum value outside its min and max
properties can produce an uninitialized pointer in safe code, void
initialization is not required. The solution seems to be to fix issue 11051.

--


[Issue 11051] Unmatched case in a final switch should throw in both release and non-release mode

2023-01-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11051

Nick Treleaven  changed:

   What|Removed |Added

   See Also||https://issues.dlang.org/sh
   ||ow_bug.cgi?id=14643

--


[Issue 14643] Safety violation with final switch and void initializer

2023-01-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14643

Nick Treleaven  changed:

   What|Removed |Added

 CC||n...@geany.org

--- Comment #2 from Nick Treleaven  ---
Note that an enum E is allowed to take values larger than E.max using binary
operations:

enum E { a, b}
pragma(msg, E.max); // E.b which is 1
E value = E.b << E.b; // 2

So that violates `final switch` anyway, even in @safe code, and casting can
(see https://issues.dlang.org/show_bug.cgi?id=11051#c7). Though void
initialization is worse because the bug might not even be reproducible. Sadly
void initialization is not banned in @safe.

--


[Issue 18146] A case expression of final switch allows to pass wrong enum value

2023-01-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18146

Nick Treleaven  changed:

   What|Removed |Added

 CC||n...@geany.org

--- Comment #4 from Nick Treleaven  ---
The problem in comment #3 seems to be these lines:

class Bezier(BezierOrder TYP){
  enum ubyte N= cast(ubyte)TYP+1u;
  typeof(this)[2] offsetCurve(in double width) @safe const
  do{
final switch(TYP){
case BezierOrder.Line:
  static assert(N == 2u);  // compile-time error is generated here
  break;
case BezierOrder.Quadratic:
  static assert(N == 3u);

*All* the code inside `final switch` will be *compiled* regardless of the value
of `TYP`. `final switch` works at runtime even when given a compile-time
argument. So the compiler will try to compile *both* `static asserts` in the
`final switch`.

> In order to avoid the problem, I tried to use static if statements instead of 
> a final switch statement.

Yes, because `static if` branches are only compiled if the compile-time
condition is true.

--


[Issue 23635] Nonsensical "`case` must be a `string` or an integral constant, not `x`"

2023-01-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23635

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@ntrel created dlang/dmd pull request #14840 "Fix Issue 23635 - Nonsensical
"`case` must be a `string` or an integr…" fixing this issue:

- Fix Issue 23635 - Nonsensical "`case` must be a `string` or an integral
constant, not `x`"

https://github.com/dlang/dmd/pull/14840

--


[Issue 5714] case ranges in final switches

2023-01-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5714

Nick Treleaven  changed:

   What|Removed |Added

 CC||n...@geany.org

--- Comment #4 from Nick Treleaven  ---
(In reply to Andrej Mitrovic from comment #1)
> And it also limits the number of cases to 256 (for optimization purposes?).
> 
> So a final switch would only work on byte-types.

See issue 15279 which seems to be an implementation issue rather than a design
decision (the pull comment suggests lowering case range statements to an
if/else instead).

--


[Issue 23467] tools/dspec_tester.d calls readText multiple times per file

2023-01-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23467

Nick Treleaven  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Nick Treleaven  ---
Fixed by above pull.

--


[Issue 15368] Improve error message for "auto" keyword inside "foreach"

2023-01-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15368

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@dkorpel created dlang/dmd pull request #14839 "Fix 15368 - improve error
message when using auto in foreach" fixing this issue:

- fix 15368 - improve error message when using auto in foreach

https://github.com/dlang/dmd/pull/14839

--