[Issue 7482] deprecation isn't checked inside forward referenced typeof()

2019-05-24 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7482

RazvanN  changed:

   What|Removed |Added

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

--- Comment #6 from RazvanN  ---
Hello all, I come from the future where accessing deprecated symbols is not an
error. Now, deprecations are issued for both accesses of Z and no assert is
triggered, which is the correct behavior. Closing as invalid.

--


[Issue 7482] deprecation isn't checked inside forward referenced typeof()

2015-06-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7482

Andrei Alexandrescu and...@erdani.com changed:

   What|Removed |Added

Version|D1  D2 |D2

--


[Issue 7482] deprecation isn't checked inside forward referenced typeof()

2012-02-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7482


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

Summary|deprecation isn't checked   |deprecation isn't checked
   |inside forward referenced   |inside forward referenced
   |is(typeof())|typeof()


--- Comment #5 from Don clugd...@yahoo.com.au 2012-02-16 12:28:46 PST ---
 Deprecation is most definitely not about declarations not existing. It is 
 about being an error to reference them.
Right, but is(typeof(X)) isn't a check if X exists, even though a popular idiom
is to use it for that purpose. Rather, it asks what type X has. And I think
that has to be considered as referencing X, and is therefore an error.
If it's not an error, it has to be able to provide a type, and that's a
problem:

static if (is(typeof(Z)  M)) {
M we_are_relying_on_a_deprecated_variable;
}

deprecated int Z;

But it turns out that this bug has nothing to do with is().

alias typeof(Z) Q1; // compiles

deprecated int Z;

alias typeof(Z) Q2; // doesn't compile


In fact, it seems it doesn't even require deprecated:

alias typeof(Z1) Q1;
pragma(msg, Q1.stringof); // int

const int Z1;

alias typeof(Z1) R1;
pragma(msg, R1.stringof); // const(int)

and yet if you write const (int) Z1; it displays const(int) in both cases.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---