Re: Broken TLS?

2016-07-27 Thread ag0aep6g via Digitalmars-d-learn

On 07/28/2016 12:38 AM, Dechcaudron wrote:

Giving my 20 votes to the issue (are votes even taken into account?). At
least now I know the source of attribute-enforcements breakdown is
basically delegate management. That should help me out enough so I don't
have this issue anymore.

Thanks a bunch. Can I get your votes on that issue?


As far as I know, no one cares much about votes. I'm not going to bother 
with them. This being a pretty serious accepts-invalid bug, it needs 
fixing regardless of votes.


And unfortunately there are even more important/urgent bugs. There are 
37 open dmd regressions [1], and 158 open wrong-code bugs [2]. Maybe not 
all of them are more important than the bug at hand, but a good bunch 
probably are.


If voting did anything, I'd put everything into issues 15862 [3] and 
16292 [4]. 15862 is a ridiculous wrong-code bug with pure nothrow 
functions. 16292 is a rejects-valid regression that is a blocking a toy 
project of mine (already has a pull request).



[1] 
https://issues.dlang.org/buglist.cgi?bug_severity=regression=dmd_id=209764_format=advanced=---
[2] 
https://issues.dlang.org/buglist.cgi?component=dmd=wrong-code_type=allwords_id=209765_format=advanced=---

[3] https://issues.dlang.org/show_bug.cgi?id=15862
[4] https://issues.dlang.org/show_bug.cgi?id=16292


Re: Broken TLS?

2016-07-27 Thread Dechcaudron via Digitalmars-d-learn

On Wednesday, 27 July 2016 at 20:54:00 UTC, ag0aep6g wrote:
Looks pretty bad. There's an open issue on this: 
https://issues.dlang.org/show_bug.cgi?id=16095


Giving my 20 votes to the issue (are votes even taken into 
account?). At least now I know the source of 
attribute-enforcements breakdown is basically delegate 
management. That should help me out enough so I don't have this 
issue anymore.


Thanks a bunch. Can I get your votes on that issue?




Re: Broken TLS?

2016-07-27 Thread ag0aep6g via Digitalmars-d-learn

On 07/27/2016 09:19 PM, Dechcaudron wrote:

struct Foo
{

[...]


void ping() shared
{

[...]

}

void fire()
{
spawn();
}

void explode() shared
{
ping();
}
}

void main()
{
auto a = Foo(1, 2);
a.fire();

thread_joinAll();
}


[...]


Is there anything I'm doing wrong? I won't lie, data sharing is the only
thing about D I don't find quite usable yet. Can anybody help me out on
this?


I think the program should not compile. You can't call a shared method 
on an unshared struct/class, so you shouldn't be able to take make a 
delegate of it and call that.


Reduced code:


struct Foo
{
void ping() shared {}
}

void main()
{
Foo a;
// a.ping(); // rejected
()(); // accepted
}


We can also break immutable/const with this:


struct Foo
{
int x = 0;
void ping() { x = 1; }
}

void main()
{
immutable Foo a;
// a.ping(); // rejected
()(); // accepted
assert(a.x == 0); // fails
}


Looks pretty bad. There's an open issue on this: 
https://issues.dlang.org/show_bug.cgi?id=16095