Re: Beta D 2.071.0-b2

2016-04-04 Thread Steven Schveighoffer via Digitalmars-d-announce

On 4/3/16 7:59 AM, tost wrote:

On Wednesday, 30 March 2016 at 11:03:51 UTC, Martin Nowak wrote:

Second beta for the 2.071.0 release.

http://dlang.org/download.html#dmd_beta
http://dlang.org/changelog/2.071.0.html

Please report any bugs at https://issues.dlang.org

-Martin


//foo.d
module foo;

void main() {}

class A {

 void bar(int i) {}

 void baz() {
 import othermodule;
 bar("abc");
 }
}

// othermodule.d
module othermodule;

void bar(string s) {}

compiled with

dmd foo.d othermodule.d

gives

foo.d(11): Error: function foo.A.bar (int i) is not callable using
argument types (string)

is this a feature of the new name lookup algorithm or a bug? Adapting my
codebase would be trivial :)


Yes. There are new lookup rules. See my post about it here: 
http://www.schveiguy.com/blog/2016/03/import-changes-in-d-2-071/


To fix, you should import with selective:

import othermodule: bar;

If you need both bar(int) and bar(string) from their respective 
locations, I'd suggest a renaming import.


-Steve


Re: Beta D 2.071.0-b2

2016-04-03 Thread Rory McGuire via Digitalmars-d-announce
On Sun, Apr 3, 2016 at 1:59 PM, tost via Digitalmars-d-announce <
digitalmars-d-announce@puremagic.com> wrote:

> On Wednesday, 30 March 2016 at 11:03:51 UTC, Martin Nowak wrote:
>
>> Second beta for the 2.071.0 release.
>>
>> http://dlang.org/download.html#dmd_beta
>> http://dlang.org/changelog/2.071.0.html
>>
>> Please report any bugs at https://issues.dlang.org
>>
>> -Martin
>>
>
> //foo.d
> module foo;
>
> void main() {}
>
> class A {
>
> void bar(int i) {}
>
> void baz() {
> import othermodule;
> bar("abc");
> }
> }
>
> // othermodule.d
> module othermodule;
>
> void bar(string s) {}
>
> compiled with
>
> dmd foo.d othermodule.d
>
> gives
>
> foo.d(11): Error: function foo.A.bar (int i) is not callable using
> argument types (string)
>
> is this a feature of the new name lookup algorithm or a bug? Adapting my
> codebase would be trivial :)
>

I think compiler is supposed to stop you from doing that to protect against
hijacking.
http://dlang.org/hijack.html

R


Re: Beta D 2.071.0-b2

2016-04-03 Thread tost via Digitalmars-d-announce

On Wednesday, 30 March 2016 at 11:03:51 UTC, Martin Nowak wrote:

Second beta for the 2.071.0 release.

http://dlang.org/download.html#dmd_beta 
http://dlang.org/changelog/2.071.0.html


Please report any bugs at https://issues.dlang.org

-Martin


//foo.d
module foo;

void main() {}

class A {

void bar(int i) {}

void baz() {
import othermodule;
bar("abc");
}
}

// othermodule.d
module othermodule;

void bar(string s) {}

compiled with

dmd foo.d othermodule.d

gives

foo.d(11): Error: function foo.A.bar (int i) is not callable 
using argument types (string)


is this a feature of the new name lookup algorithm or a bug? 
Adapting my codebase would be trivial :)


Re: Beta D 2.071.0-b2

2016-04-01 Thread Jacob Carlborg via Digitalmars-d-announce

On 2016-03-31 21:21, Steven Schveighoffer wrote:


Right, so definitely a bug in the compiler. The -transition=checkimports
flag is supposed to tell you about changes in behavior between the prior
regime (achieved with -transition=import) and the current regime.

-Steve


Reported two bugs:

https://issues.dlang.org/show_bug.cgi?id=15857
https://issues.dlang.org/show_bug.cgi?id=15856

--
/Jacob Carlborg


Re: Beta D 2.071.0-b2

2016-03-31 Thread Jacob Carlborg via Digitalmars-d-announce

On 2016-03-31 16:59, Steven Schveighoffer wrote:

The compiler. Your first post has a deprecation indicating it found a
symbol twice in the same place :) The second seems like there should be
no issues. I assume it compiles identically both with and without
-transition=import? If that's the case, there should be no message.


Both examples compile the same with and without -transition=import. The 
issues only appear with the -transition=checkimports flag enabled.


--
/Jacob Carlborg


Re: Beta D 2.071.0-b2

2016-03-31 Thread Steven Schveighoffer via Digitalmars-d-announce

On 3/31/16 10:29 AM, Jacob Carlborg wrote:

On 2016-03-31 15:21, Steven Schveighoffer wrote:


These sure seem like bugs (including your other post).


In my code or in the compiler?


The compiler. Your first post has a deprecation indicating it found a 
symbol twice in the same place :) The second seems like there should be 
no issues. I assume it compiles identically both with and without 
-transition=import? If that's the case, there should be no message.


-Steve


Re: Beta D 2.071.0-b2

2016-03-31 Thread Jacob Carlborg via Digitalmars-d-announce

On 2016-03-31 15:21, Steven Schveighoffer wrote:


These sure seem like bugs (including your other post).


In my code or in the compiler?


The repetition (in case you are wondering) is because the compiler
prints a message for every usage of a symbol. In this case, you defined
two symbols, so you get two deprecation messages.

Note these aren't error messages, you should still get a binary.


Yeah, deprecation messages.

--
/Jacob Carlborg


Re: Beta D 2.071.0-b2

2016-03-31 Thread Steven Schveighoffer via Digitalmars-d-announce

On 3/31/16 3:22 AM, Jacob Carlborg wrote:

On 2016-03-30 13:03, Martin Nowak wrote:

Second beta for the 2.071.0 release.


I've found other confusing error messages. Compiling the following code:

class Foo
{
 import core.stdc.config;

 struct Bar
 {
 c_long a, b; // line 7
 }
}

With the -transition=checkimports flag gives the following error messages:

main.d(1): Deprecation: class main.Foo alias core.stdc.config.c_long
found in local import
main.d(7): Deprecation: local import search method found nothing (null)
instead of alias core.stdc.config.c_long
main.d(1): Deprecation: class main.Foo alias core.stdc.config.c_long
found in local import
main.d(7): Deprecation: local import search method found nothing (null)
instead of alias core.stdc.config.c_long



These sure seem like bugs (including your other post).

The repetition (in case you are wondering) is because the compiler 
prints a message for every usage of a symbol. In this case, you defined 
two symbols, so you get two deprecation messages.


Note these aren't error messages, you should still get a binary.

-Steve


Re: Beta D 2.071.0-b2

2016-03-31 Thread Jacob Carlborg via Digitalmars-d-announce

On 2016-03-30 13:03, Martin Nowak wrote:

Second beta for the 2.071.0 release.


I've found other confusing error messages. Compiling the following code:

class Foo
{
import core.stdc.config;

struct Bar
{
c_long a, b; // line 7
}
}

With the -transition=checkimports flag gives the following error messages:

main.d(1): Deprecation: class main.Foo alias core.stdc.config.c_long 
found in local import
main.d(7): Deprecation: local import search method found nothing (null) 
instead of alias core.stdc.config.c_long
main.d(1): Deprecation: class main.Foo alias core.stdc.config.c_long 
found in local import
main.d(7): Deprecation: local import search method found nothing (null) 
instead of alias core.stdc.config.c_long


--
/Jacob Carlborg


Re: Beta D 2.071.0-b2

2016-03-31 Thread Jacob Carlborg via Digitalmars-d-announce

On 2016-03-30 13:03, Martin Nowak wrote:

Second beta for the 2.071.0 release.


I'm compiling my projects using the new beta. I get some errors about 
the new import rules that I don't really understand:


clang/Type.d(114,24): Deprecation: local import search method found 
overloadset clang.Type.isEmpty instead of overloadset clang.Type.isEmpty


This is where it complains [1], "isEmpty" pulled in from here [2] and 
declared here [3].


[1] https://github.com/jacob-carlborg/dstep/blob/master/clang/Type.d#L114

[2] https://github.com/jacob-carlborg/dstep/blob/master/clang/Type.d#L9

[3] 
https://github.com/jacob-carlborg/mambo/blob/master/mambo/core/Array.d#L110


--
/Jacob Carlborg


Re: Beta D 2.071.0-b2

2016-03-30 Thread Basile B. via Digitalmars-d-announce

On Wednesday, 30 March 2016 at 12:04:19 UTC, Basile B. wrote:

On Wednesday, 30 March 2016 at 11:03:51 UTC, Martin Nowak wrote:

Second beta for the 2.071.0 release.

http://dlang.org/download.html#dmd_beta 
http://dlang.org/changelog/2.071.0.html


Please report any bugs at https://issues.dlang.org

-Martin


Two regressions found in previous beta are now fixed. Otherwise 
NAD.


Actually this morning I've setup and tested 2.070.2 instead of 
the beta and now, with the right version, one of the regression 
is still there.

Unfortunately I was not able to make a good report:

https://issues.dlang.org/show_bug.cgi?id=15836


Re: Beta D 2.071.0-b2

2016-03-30 Thread John Colvin via Digitalmars-d-announce

On Wednesday, 30 March 2016 at 16:00:34 UTC, Luís Marques wrote:

On Wednesday, 30 March 2016 at 15:48:28 UTC, John Colvin wrote:
That would be me. Waiting for merge: 
https://github.com/Homebrew/homebrew/pull/50539


Thanks!

Would it be against the homebrew spirit for the DMD recipe to 
link to some URL like <...lastest-devel.tar.gz>? After all, 
that already happens with the --HEAD version, which doesn't 
link to any specific git commit. That way we wouldn't have to 
wait for the homebrew merges. There's the issue of the hash, 
but the --HEAD version doesn't have that either, and 
https://dlang.org should be trusted.


I'm 99.9% certain the Homebrew core devs wouldn't allow something 
like that.


Re: Beta D 2.071.0-b2

2016-03-30 Thread Luís Marques via Digitalmars-d-announce

On Wednesday, 30 March 2016 at 15:48:28 UTC, John Colvin wrote:
That would be me. Waiting for merge: 
https://github.com/Homebrew/homebrew/pull/50539


Thanks!

Would it be against the homebrew spirit for the DMD recipe to 
link to some URL like <...lastest-devel.tar.gz>? After all, that 
already happens with the --HEAD version, which doesn't link to 
any specific git commit. That way we wouldn't have to wait for 
the homebrew merges. There's the issue of the hash, but the 
--HEAD version doesn't have that either, and https://dlang.org 
should be trusted.


Re: Beta D 2.071.0-b2

2016-03-30 Thread John Colvin via Digitalmars-d-announce

On Wednesday, 30 March 2016 at 13:04:08 UTC, Luís Marques wrote:

On Wednesday, 30 March 2016 at 11:03:51 UTC, Martin Nowak wrote:

Second beta for the 2.071.0 release.

http://dlang.org/download.html#dmd_beta 
http://dlang.org/changelog/2.071.0.html


Please report any bugs at https://issues.dlang.org

-Martin


Who maintains the homebrew recipe? The --devel package is still 
at beta 1.


That would be me. Waiting for merge: 
https://github.com/Homebrew/homebrew/pull/50539


Re: Beta D 2.071.0-b2

2016-03-30 Thread Luís Marques via Digitalmars-d-announce

On Wednesday, 30 March 2016 at 11:03:51 UTC, Martin Nowak wrote:

Second beta for the 2.071.0 release.

http://dlang.org/download.html#dmd_beta 
http://dlang.org/changelog/2.071.0.html


Please report any bugs at https://issues.dlang.org

-Martin


Who maintains the homebrew recipe? The --devel package is still 
at beta 1.


Re: Beta D 2.071.0-b2

2016-03-30 Thread Basile B. via Digitalmars-d-announce

On Wednesday, 30 March 2016 at 11:03:51 UTC, Martin Nowak wrote:

Second beta for the 2.071.0 release.

http://dlang.org/download.html#dmd_beta 
http://dlang.org/changelog/2.071.0.html


Please report any bugs at https://issues.dlang.org

-Martin


Two regressions found in previous beta are now fixed. Otherwise 
NAD.