[Issue 15909] New: Duplicate case error reports characters as numbers

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15909

  Issue ID: 15909
   Summary: Duplicate case error reports characters as numbers
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: trivial
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: andy.pj.han...@gmail.com

This code:

void main() {
switch ('a') {
case 'a': case 'a':
break;
}
}

Fails with this error:

app.d(3): Error: duplicate case 97 in switch statement

It would be nicer to use 'a' instead of 97.

--


[Issue 15908] New: Implicitly typed lambda inside class "has no value"

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15908

  Issue ID: 15908
   Summary: Implicitly typed lambda inside class "has no value"
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: andy.pj.han...@gmail.com

There is a compile error for an implicitly typed lambda expression inside a
class.

import std.algorithm : map;
auto a = [1,2,3].map!(i => i);
class X {
static auto b = [1,2,3].map!((int i) => i);
// /usr/include/dmd/phobos/std/algorithm/iteration.d(455): Error:
this.__lambda4 has no value
static auto c = [1,2,3].map!(i => i);
}

`a` and `b` compile just fine, but `c` causes a compile error. (The error
message doesn't indicate what caused it, though.)

--


[Issue 11628] nested scope guards go cyclic

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11628

j...@red.email.ne.jp changed:

   What|Removed |Added

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

--- Comment #2 from j...@red.email.ne.jp ---
I close this as WORKSFORME.

--


[Issue 8030] Multiple override are allowed using mixin template

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8030

andy.pj.han...@gmail.com changed:

   What|Removed |Added

 CC||andy.pj.han...@gmail.com

--- Comment #2 from andy.pj.han...@gmail.com ---
Related: overloads don't appear to be recognized from within mixin templates.
---
class X {
void x() {}
mixin template T() {
void x(int y) { x(); }
}
mixin T;
}
// app.d(4): Error: function app.X.T!().x (int y) is not callable using
argument types ()

--


[Issue 11429] Deprecate walkLength?

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11429

greenify  changed:

   What|Removed |Added

 CC||greeen...@gmail.com

--- Comment #2 from greenify  ---
Hmm I personally like count a lot more and there is already minCount and
maxCount in std.algorithm

--


[Issue 15907] Unjustified "is not visible from module" deprecation warning when using getMember trait

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15907

--- Comment #1 from m.bier...@lostmoment.com ---
I forgot to add that it's actually "getMember" which causes the deprecation
warning and "allMembers" is not fully qualified.

--


[Issue 15907] Unjustified "is not visible from module" deprecation warning when using getMember trait

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15907

m.bier...@lostmoment.com changed:

   What|Removed |Added

Summary|Unjustified "is not visible |Unjustified "is not visible
   |from module" deprecation|from module" deprecation
   |warning when using  |warning when using
   |allMembers trait|getMember trait

--


[Issue 15907] Unjustified "is not visible from module" deprecation warning when using allMembers trait

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15907

m.bier...@lostmoment.com changed:

   What|Removed |Added

Summary|Unjustified "is not visible |Unjustified "is not visible
   |from module" deprecation|from module" deprecation
   |warning |warning when using
   ||allMembers trait

--


[Issue 15907] Unjustified "is not visible from module" deprecation warning

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15907

m.bier...@lostmoment.com changed:

   What|Removed |Added

 CC||m.bier...@lostmoment.com

--


[Issue 15907] New: Unjustified "is not visible from module" deprecation warning

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15907

  Issue ID: 15907
   Summary: Unjustified "is not visible from module" deprecation
warning
   Product: D
   Version: D2
  Hardware: x86_64
OS: Windows
Status: NEW
  Severity: regression
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: m.bier...@lostmoment.com

Some libraries use the "allMembers" trait to get access to all members of an
instance, including private members. The change "Import access checks for fully
qualified names were fixed.", introduced in DMD 2.071.0, now shows a
deprecation warning in cases where the library module accesses members of
classes (and structs, probably) which were not imported in that module.

Consider the following code:

--
module app;

import library;

class FirstClass {}

class SecondClass {
private FirstClass firstClass;
}


void main() {
auto manipulator= new PrivateMemberManipulator();
auto instance = new SecondClass();
manipulator.process!SecondClass(instance);
}

--
module library;

import std.traits;

class PrivateMemberManipulator {
public void process(Type)(Type instance) {
foreach (member ; __traits(allMembers, Type)) {
static if (__traits(getProtection, __traits(getMember, instance,
member)) == "private") {
// Do things
}
}
}
}
-

When compiled, the following deprecation warning is shown:
src\library.d(8,39): Deprecation: app.SecondClass.firstClass is not visible
from module library

This is because the results of "allMembers" are fully qualified (as they should
be).

I feel this usage is perfectly legal as there is no way a library can (or
should) import all application classes.

--


[Issue 15906] GIT HEAD undefined references

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15906

--- Comment #1 from Temtaime  ---
Adding .array before second map fixes the issue

--


[Issue 15906] New: GIT HEAD undefined references

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15906

  Issue ID: 15906
   Summary: GIT HEAD undefined references
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: regression
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: temta...@gmail.com

import std.algorithm, std.file, std.string;

void main() {
[ `` ].map!(a => dirEntries(a, `*.d`, SpanMode.depth).map!(a =>
a.name).join).join;
}

error LNK2019: unresolved external symbol
_D173TypeInfo_xS3std9algorithm9iteration121__T12FilterResultS76_D3std4file10dirEntriesFAyaAyaE3std4file8SpanModebZ1fMFS3std4file8DirEntryZbTS3std4file11DirIteratorZ12FilterResult6__initZ
referenced in function
_D3std9algorithm9iteration239__T9MapResultS584main4mainFZ18__T9__lambda1TAyaZ9__lambda1MFAyaZ9__lambda2TS3std9algorithm9iteration121__T12FilterResultS76_D3std4file10dirEntriesFAyaAyaE3std4file8SpanModebZ1fMFS3std4file8DirEntryZbTS3std4file11DirIteratorZ12FilterResultZ9MapResult9__xtoHashFNbNeKxS3std9algorithm9iteration239__T9MapResultS584main4mainFZ18__T9__lambda1TAyaZ9__lambda1MFAyaZ9__lambda2TS3std9algorithm9iteration121__T12FilterResultS76_D3std4file10dirEntriesFAyaAyaE3std4file8SpanModebZ1fMFS3std4file8DirEntryZbTS3std4file11DirIteratorZ12FilterResultZ9MapResultZm

--


[Issue 15905] New: Tuple Op Assignment Overload incorrect?

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15905

  Issue ID: 15905
   Summary: Tuple Op Assignment Overload incorrect?
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: pontife...@gmail.com

I've come across some wonky behavior with a Tuple's *= operator in 2.071.

Here's a sample:



import std.stdio;

import std.typecons;


alias SomeStuff = Tuple!(float, "value");

void main()
{
  auto bob = SomeStuff(-1.0f);// Prints:
  writeln(bob);   // Tuple!(float, "value")(-1)
  bob.value *= -1;
  writeln(bob);   // Tuple!(float, "value")(-1.2) 
 WRONG 

  auto sue = SomeStuff(-1.0f);
  writeln(sue);   // Tuple!(float, "value")(-1)
  sue.value = sue.value * -1;
  writeln(sue);   // Tuple!(float, "value")(1)

  auto interesting = SomeStuff(-1.0f);
  writeln(interesting);   // Tuple!(float, "value")(-1)
  interesting.value *= -2;
  writeln(interesting);   // Tuple!(float, "value")(2)
What?
}


I'm running Arch Linux with DMD 2.071. Downgrading to 2.070 produces the
following correct output:

$ dmd --version; dmd app.d; ./app
DMD64 D Compiler v2.070
Copyright (c) 1999-2015 by Digital Mars written by Walter Bright
Tuple!(float, "value")(-1)
Tuple!(float, "value")(1)
Tuple!(float, "value")(-1)
Tuple!(float, "value")(1)
Tuple!(float, "value")(-1)
Tuple!(float, "value")(2)

Same cmd on 2.071 for reference.

$ dmd --version; dmd app.d; ./app
DMD64 D Compiler v2.071.0
Copyright (c) 1999-2015 by Digital Mars written by Walter Bright
Tuple!(float, "value")(-1)
Tuple!(float, "value")(-1.2)
Tuple!(float, "value")(-1)
Tuple!(float, "value")(1)
Tuple!(float, "value")(-1)
Tuple!(float, "value")(2)

--


[Issue 15904] New: Undefined reference to ModuleInfo

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15904

  Issue ID: 15904
   Summary: Undefined reference to ModuleInfo
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: andy.pj.han...@gmail.com

This error requires multiple modules to reproduce.
Recursive imports, `static this`, and `package.d`-style imports are all
apparently required to cause the error.

app.d:

import foo;
void main() {}
static this() {}

foo/package.d:

import app;

The output of `dmd app.d` is:
app.o:(.rodata+0x18): undefined reference to `_D3foo12__ModuleInfoZ'
collect2: error: ld returned 1 exit status
--- errorlevel 1

--


[Issue 15903] [REG 2.071] module foo.bar is not accessible here, perhaps add 'static import foo.bar; (already there)

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15903

Timothee Cour  changed:

   What|Removed |Added

Summary|module foo.bar is not   |[REG 2.071] module foo.bar
   |accessible here, perhaps|is not accessible here,
   |add 'static import foo.bar; |perhaps add 'static import
   |(already there) |foo.bar; (already there)

--


[Issue 15903] module foo.bar is not accessible here, perhaps add 'static import foo.bar; (already there)

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15903

--- Comment #3 from Timothee Cour  ---
slightly different scenario but could be same root cause, with a minimal test
case:

$dmd_071_X -o- -c D20160409T132716/main.d
Deprecation: module std.conv is not accessible here, perhaps add 'static import
std.conv;'


module D20160409T132716.main;

import D20160409T132716.test;
void fun(){
  auto b=std.conv.to!string(0);
}

module D20160409T132716.test;
public static import std.conv;


--


[Issue 15903] module foo.bar is not accessible here, perhaps add 'static import foo.bar; (already there)

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15903

--- Comment #2 from Timothee Cour  ---
perhaps related to issue/15900 ?

--


[Issue 2043] Closure outer variables in nested blocks are not allocated/instantiated correctly: should have multiple instances but only have one.

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2043

ZombineDev  changed:

   What|Removed |Added

 CC||petar.p.ki...@gmail.com

--


[Issue 1983] Delegates violate const

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=1983

ZombineDev  changed:

   What|Removed |Added

 CC||petar.p.ki...@gmail.com

--


[Issue 15890] IFTI for static array argument length when element type supplied

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15890

ZombineDev  changed:

   What|Removed |Added

 CC||petar.p.ki...@gmail.com

--


[Issue 15402] allow private access to package symbols

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15402

ZombineDev  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 CC||petar.p.ki...@gmail.com
 Resolution|FIXED   |---

--- Comment #3 from ZombineDev  ---
I'm reopening because the commit was not actually pushed to master or stable.

--


[Issue 15402] allow private access to package symbols

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15402

--- Comment #2 from github-bugzi...@puremagic.com ---
Commit pushed to fix15402 at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/c424690156a6f2b4f402415c45e780833f2f2df2
fix Issue 15402 - allow private access to package symbols

--


[Issue 15402] allow private access to package symbols

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15402

github-bugzi...@puremagic.com changed:

   What|Removed |Added

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

--


[Issue 15402] allow private access to package symbols

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15402

Martin Nowak  changed:

   What|Removed |Added

Summary|Make it an error to declare |allow private access to
   |package level symbols when  |package symbols
   |there is no package |

--


[Issue 15402] Make it an error to declare package level symbols when there is no package

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15402

Martin Nowak  changed:

   What|Removed |Added

 CC||c...@dawg.eu

--- Comment #1 from Martin Nowak  ---
Package is a superset of private, so it should allow the same access.

--


[Issue 15773] D's treatment of whitespace in character classes in free-form regexes is not the same as Perl's

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15773

github-bugzi...@puremagic.com changed:

   What|Removed |Added

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

--


[Issue 15773] D's treatment of whitespace in character classes in free-form regexes is not the same as Perl's

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15773

--- Comment #2 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/5e4853f723c2c10a9767befae7b84e5c880be361
Fix issue 15773 - D's treatment of whitespace in character classes in free-form
regexes is not the same as Perl's

https://github.com/D-Programming-Language/phobos/commit/cdf2443a33cf638495506291b090b115d39301ea
Merge pull request #4162 from DmitryOlshansky/issue-15573

Fix issue 15773 - D's treatment of whitespace in character classes in…

--


[Issue 15899] Tuple.toString not recognized as a function with isSomeFunction

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15899

Edwin van Leeuwen  changed:

   What|Removed |Added

 CC||ed...@tkwsping.nl

--


[Issue 15903] module foo.bar is not accessible here, perhaps add 'static import foo.bar; (already there)

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15903

Timothee Cour  changed:

   What|Removed |Added

 CC||timothee.co...@gmail.com

--- Comment #1 from Timothee Cour  ---
[unfortunately seems hard to reduce]

--


[Issue 15903] New: module foo.bar is not accessible here, perhaps add 'static import foo.bar; (already there)

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15903

  Issue ID: 15903
   Summary: module foo.bar is not accessible here, perhaps add
'static import foo.bar; (already there)
   Product: D
   Version: D2
  Hardware: x86
OS: Mac OS X
Status: NEW
  Severity: regression
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: timothee.co...@gmail.com

I am getting a nonsensical deprecation telling me to add static import foo.bar;
when it's right there already

dmd version: 
DMD64 D Compiler v2.070-devel-36feb02 (but due to another bug I reported it's
actually the latest 2.071)

...
static import foo.bar;
class Foo(T...)   if(foo.bar.fun!(foo.bar.baz!(int), T)) { ...} // deprecation
msg
...

--


[Issue 15884] Assigning char[] to std.json.JSONValue creates array, not string

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15884

b2.t...@gmx.com changed:

   What|Removed |Added

 CC||b2.t...@gmx.com

--- Comment #2 from b2.t...@gmx.com ---
(In reply to Lionello Lunesu from comment #1)
> Ugh, I understand why it's the way it is.
> 
> Should we do .idup in JSONValue? Either way there's going to be an
> allocation, either for the JSONValue[] or for the string.
> 
> The repro might seem convoluted, but I ran into it like this: a method
> returns a char[], in order to give the caller full r/w control, which is
> what such a "toString" function is supposed to do. Using this return value
> (which thanks to "auto" is not obvious) in a JSONValue results in a less
> than ideal JSON.

I have tested a fix and calling idup doesn't break current tests, actually the
method that's involved to make it accepts char[] is a template and with
attribute inference there is no problem. It's always pure nothrow @safe, safe
is a new requirement on the master version of std.json.

--


[Issue 15902] std.range.Take.opSlice is incorrect

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15902

Vlad Levenfeld  changed:

   What|Removed |Added

 OS|Linux   |All

--


[Issue 15902] New: std.range.Take.opSlice is incorrect

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15902

  Issue ID: 15902
   Summary: std.range.Take.opSlice is incorrect
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: major
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: vlevenf...@gmail.com

std/range/package.d : L1842

source[i..j-i] should be source[i..j]

Otherwise you would have

xs.take(5)[2..3] => xs[2..1]

--


[Issue 15901] New: Perfect hash map for the visual D lexer

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15901

  Issue ID: 15901
   Summary: Perfect hash map for the visual D lexer
   Product: D
   Version: D2
  Hardware: All
OS: Windows
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: visuald
  Assignee: nob...@puremagic.com
  Reporter: b2.t...@gmx.com

I can provide a perfect hash map for the visual D lexer
(https://github.com/D-Programming-Language/visuald/blob/master/vdc/lexer.d).

It would be quite similar to this one:

https://github.com/BBasile/d2kw/blob/master/src/d2kw.d

but with the keywords list as defined in VisualD. Maybe 256 will be a bit hard
to generate but 384 or 512 will be OK. 512 is fine for a slightly faster hash.

Reply or contact me if you're interested.

--


[Issue 15839] [REG2.071-b1] this.outer is of wrong type

2016-04-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15839

--- Comment #11 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/bb5f550edd77ad780878b8fba89820b001b43554
fix Issue 15839 - this.outer is of wrong type

https://github.com/D-Programming-Language/dmd/commit/1aa8a1e8ebe9893f04d689319dd0606bede83fac
Merge pull request #5613 from 9rnsr/fix15839

--