[Issue 17716] wrong result of IsExpression when not in static assert

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17716

Iain Buclaw  changed:

   What|Removed |Added

   Priority|P1  |P3

--


[Issue 17716] wrong result of IsExpression when not in static assert

2018-09-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17716

--- Comment #4 from er.kr...@gmail.com ---
(In reply to ag0aep6g from comment #3)
> 
> You made the same comment on issue 17729, and it makes more sense there. I
> guess you posted it here by accident?

Yes I did, I didn't notice that bugzilla had moved to the "next" bug and I
thought it hadn't been posted. If there's a way to remove it (and this comment,
if needed), please do, I don't think I can do it myself.

--


[Issue 17716] wrong result of IsExpression when not in static assert

2018-09-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17716

--- Comment #3 from ag0aep6g  ---
(In reply to er.krali from comment #2)
> Furthermore, it doesn't work with ref parameters either:
[...]

You made the same comment on issue 17729, and it makes more sense there. I
guess you posted it here by accident?

--


[Issue 17716] wrong result of IsExpression when not in static assert

2018-09-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17716

er.kr...@gmail.com changed:

   What|Removed |Added

 CC||er.kr...@gmail.com

--- Comment #2 from er.kr...@gmail.com ---
Furthermore, it doesn't work with ref parameters either:

---
struct S {
int i;
}

void fun(ref S s, int i) {
s.i = i;
}

void main() {
shared S s;

/* This fails:

   onlineapp.d(17): Error: function onlineapp.fun(ref S s, int i) is not
callable using argument types (S, int)
   onlineapp.d(17):cannot pass rvalue argument cast(S)s of type S
to parameter ref S s

fun(cast(S) s, 1);

*/

(*(cast (S*) )).fun(1); // Nasty workaround
assert (s.i == 1);
}
---

I also can't understand why the workaround works at all, the result of
dereferencing a pointer should surely be a rvalue?

Is that also a bug?

--


[Issue 17716] wrong result of IsExpression when not in static assert

2017-08-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17716

--- Comment #1 from ag0ae...@gmail.com ---
Inside functions everything works as expected:


struct S { shared int* foo; int* bar; }
pragma(msg, is(shared S : S)); /* "true" - wrong */
void f()
{
pragma(msg, is(shared S : S)); /* "false" - correct */
}


--