[Issue 13566] std.algorithm.cmp treats string length as element

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13566

Ali Cehreli  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WORKSFORME

--- Comment #4 from Ali Cehreli  ---
Compiles without an error with 2.088.

--


[Issue 10982] Misleading diagnostic for missing member function overload: "Error: inout method ... is not callable using a const object"

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10982

Ali Cehreli  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WORKSFORME

--- Comment #3 from Ali Cehreli  ---
Works as expected with 2.088. Now both errors are reported equally:

deneme.d(571): Error: function `deneme.S.is_const(int _param_0) const` is not
callable using argument types `() const`
deneme.d(571):missing argument for parameter #1: `int _param_0`
deneme.d(572): Error: function `deneme.S.is_inout(int _param_0) inout` is not
callable using argument types `() const`
deneme.d(572):missing argument for parameter #1: `int _param_0`

--


[Issue 10562] Cannot initialize arrays by an element value when the elements are fixed-length arrays

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10562

--- Comment #2 from Ali Cehreli  ---
I looked a little bit at function 'visit(AssignExp exp)' inside
dmd/src/dmd/expressionsem.d. I think this is related to the fact that a static
array initialization's left-hand expression treated as a dynamic array. This is
evident in the following error message:

  int[3][2][1] arr = 1.5; // Error: cannot implicitly convert expression `1.5`
of type `double` to `int[]`

Note how the error message says int[] instead of int[3][2][1]. I suspect this
is a bug due to code reuse in implementation.

--


[Issue 20366] CTFE foreach_reverse on array with utf characters crashes compiler

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20366

Dlang Bot  changed:

   What|Removed |Added

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

--- Comment #2 from Dlang Bot  ---
dlang/dmd pull request #10547 "Fix issue 20366 - fix a programming bug in ctfe
foreach_reverse code" was merged into stable:

- 450c957dc41fddb7b610ae8e492e8145a3235b85 by سليمان السهمي  (Suleyman Sahmi):
  Fix issue 20366 - programming bug in ctfe foreach_rverse code

  Index is not decremented which causes bounds checking error.

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

--


[Issue 20367] New: Postblit cannot be disabled when copy ctor is defined

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20367

  Issue ID: 20367
   Summary: Postblit cannot be disabled when copy ctor is defined
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: fanda.va...@volny.cz

import std.stdio;

struct A
{
int x;
this(ref return scope A rhs)
{
writeln("copy ctor: ", x);
}
@disable this(this) {writeln("postblit: ", x); }
}

void main()
{
A a;
A b = a; // copy constructor gets called
}

I've got error: Error: struct `tst.A` is not copyable because it is annotated
with `@disable`

but it should not be used according to
https://dlang.org/spec/struct.html#struct-postblit

WARNING: The postblit is considered legacy and is not recommended for new code.
Code should use copy constructors defined in the previous section. For backward
compatibility reasons, a struct that defines both a copy constructor and a
postblit will only use the postblit for implicit copying.

--


[Issue 20366] CTFE foreach_reverse on array with utf characters crashes compiler

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20366

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@SSoulaimane created dlang/dmd pull request #10547 "Fix issue 20366 - fix a
programming bug in ctfe foreach_rverse code" fixing this issue:

- Fix issue 20366 - programming bug in ctfe foreach_rverse code

  Index is not decremented which causes bounds checking error.

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

--


[Issue 20366] CTFE foreach_reverse on array with utf characters crashes compiler

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20366

Suleyman Sahmi (سليمان السهمي)  changed:

   What|Removed |Added

   Keywords||CTFE, ice,
   ||ice-on-valid-code

--


[Issue 20366] New: CTFE foreach_reverse on array with utf characters crashes compiler

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20366

  Issue ID: 20366
   Summary: CTFE foreach_reverse on array with utf characters
crashes compiler
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: critical
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: sahmi.soulaim...@gmail.com

Test case:

```
auto test()
{
const(char)[] s = ['h', 'e', 'l', '\xef', '\xbd', '\x8c', 'o'];

foreach_reverse (dchar c; s)
{
}

return true;
}

static assert(test());
```

--


[Issue 20358] External initialization of private struct fields should be disallowed

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20358

--- Comment #7 from Max Samukha  ---
(In reply to Simen Kjaeraas from comment #6)
> In favor of closing as invalid: If your type has an invariant that requires
> private fields to have specific values, you should define a constructor that
> establishes said invariant. If you don't, you've essentially told the world
> you'll accept any and all values.

But there is also lazy initialization:

// invariant is x == 1.
// neither disabled default ctor nor non-default ctors are wanted
struct S {
private int x;
void foo() {
if (x == 0) x = 1;
}
}

auto s = S(2); // problem

I agree that the issue is probably minor, because most structs with private
fields will have at least one constructor defined or disabled anyway. I
disagree that the issue is invalid.

--


[Issue 20343] false positive in style checker, checking casts

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20343

berni44  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|MOVED   |---

--- Comment #2 from berni44  ---
Sorry, moved back. According to the discussion in the Dscanner repository [1],
it's not related to Dscanner but just a wrong grep.

[1] https://github.com/dlang-community/D-Scanner/issues/781

But maybe, "tools" is the wrong component and it should be "phobos"?

--


[Issue 20358] External initialization of private struct fields should be disallowed

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20358

--- Comment #6 from Simen Kjaeraas  ---
In favor of closing as invalid: If your type has an invariant that requires
private fields to have specific values, you should define a constructor that
establishes said invariant. If you don't, you've essentially told the world
you'll accept any and all values.

If we were designing D from the start, I'd go with the private constructors I
described above*. As it is, changing this would break code for relatively small
benefit.

Even if default constructors are thought of the way Basile indicates in comment
#4, that's no excuse for S s = {x: 1};, though - that should be disallowed.


* Curly bracket initialization could be handled separately by respecting field
visibility rules, or simply disallowed - it's a blunt tool for simple types,
and more complex types with invariants can simply define a constructor. Yes,
there are valid use cases, but they can easily be handled by explicitly defined
constructors.

--


[Issue 6467] (D1 only) Static array is corrupted when concatenated

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6467

RazvanN  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||razvan.nitu1...@gmail.com
 Resolution|--- |WORKSFORME

--- Comment #1 from RazvanN  ---
This bug does not manifest in D2 and D1 is no longer supported. Closing as
WORKSFORME.

--


[Issue 6717] (D1 only) Unhelpful diagnostic on wrong end-of-instruction token in ASM

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6717

RazvanN  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||razvan.nitu1...@gmail.com
 Resolution|--- |WORKSFORME

--- Comment #3 from RazvanN  ---
D1 is no longer supported. Closing as WORKSFORME.

--


[Issue 6784] (D1 only) Compile-time constant assigned with a runtime value

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6784

RazvanN  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 CC||razvan.nitu1...@gmail.com
 Resolution|--- |WORKSFORME

--- Comment #8 from RazvanN  ---
D1 is no longer supported. Closing as WORKSFORME.

--


[Issue 7099] (D1 only) static constructor in template mixin in library not executed

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7099

RazvanN  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||razvan.nitu1...@gmail.com
 Resolution|--- |WORKSFORME

--- Comment #4 from RazvanN  ---
D1 is no longer supported, closing as WORKSFORME.

--


[Issue 7558] (D1 only) Useless 'cannot implicitly convert' errors when number of function arguments is wrong

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7558

RazvanN  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 CC||razvan.nitu1...@gmail.com
 Resolution|--- |WORKSFORME

--- Comment #7 from RazvanN  ---
D1 is no longer supported/ Closing as WORKSFORME.

--


[Issue 3852] Default struct constructors needed

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3852

RazvanN  changed:

   What|Removed |Added

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

--


[Issue 3852] Default struct constructors needed

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3852

Max Samukha  changed:

   What|Removed |Added

 CC||maxsamu...@gmail.com

--- Comment #3 from Max Samukha  ---
(In reply to RazvanN from comment #2)
> How come disbling the default constructor via `disable this();` does not
> solve your issues?
> 
> I am tempted to close this as WONTFIX as the board is probably going to be
> against adding the possibility of defining default constructors.

There was no @disabled at the time the bug was reported.

--


[Issue 12249] (D1 only) Variadic template argument deduction fails

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12249

RazvanN  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||razvan.nitu1...@gmail.com
 Resolution|--- |WORKSFORME

--- Comment #1 from RazvanN  ---
This code does not fail with the lastest gut master D2 and D1 is no longer
supported. Closing as WORKSFORME

--


[Issue 12634] [D1] Wrong code with string literal concatenation

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12634

RazvanN  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||razvan.nitu1...@gmail.com
 Resolution|--- |WORKSFORME

--- Comment #3 from RazvanN  ---
This issue does not manifest in D2 git master and D1 is no longer supported.
Closing as WORKSFORME.

--


[Issue 14334] (D1 only) Forward reference error with method returning template instance equal to typeof(this)

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14334

RazvanN  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||razvan.nitu1...@gmail.com
 Resolution|--- |WORKSFORME

--- Comment #6 from RazvanN  ---
This issue does not manifest in D2 git master and D1 is no longer supported.
Closing as WORKSFORME.

--


[Issue 14456] (D1 only) dmd doesn't call C functions with large structures correctly

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14456

RazvanN  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||razvan.nitu1...@gmail.com
 Resolution|--- |WONTFIX

--- Comment #5 from RazvanN  ---
Closing as D1 is no longer supported.

--


[Issue 15067] Broken links on D1 web site

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15067

RazvanN  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||razvan.nitu1...@gmail.com
 Resolution|--- |INVALID

--- Comment #2 from RazvanN  ---
Closing this as per Seb's comment

--


[Issue 5185] (D1 only) Recursive template expansion error in class method

2019-11-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5185

RazvanN  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||razvan.nitu1...@gmail.com
 Resolution|--- |WONTFIX

--- Comment #4 from RazvanN  ---
Does not manifest in D2 and D1 is no longer supported. Closing as WONTFIX

--