Thread overview
[Issue 1273] New: final-const-invariant.html html errors
Jun 18, 2007
d-bugmail
Jun 18, 2007
d-bugmail
Jun 18, 2007
d-bugmail
Jun 18, 2007
d-bugmail
Jun 18, 2007
d-bugmail
Jun 18, 2007
Extrawurst
Jun 18, 2007
d-bugmail
Jun 19, 2007
d-bugmail
Jan 22, 2012
Walter Bright
June 18, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1273

           Summary: final-const-invariant.html html errors
           Product: D
           Version: 2.000
          Platform: PC
               URL: http://www.digitalmars.com/d/final-const-invariant.html
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: www.digitalmars.com
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: braddr@puremagic.com


The c++ cast examples use un-quoted < and >'s,  For example, the cast away const row shows up as const_castp


-- 

June 18, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1273





------- Comment #1 from braddr@puremagic.com  2007-06-18 02:12 -------
Maybe this should be in a separate bug report, but since you can fix 'em both with  little effort, the declarations page, http://www.digitalmars.com/d/declaration.html, ought to have the const, final, and invariant StorageClass entries linked up to this explanation page.  There's nothing anywhere on the page (other than the left nav pane) to help explain 'em.


-- 

June 18, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1273





------- Comment #2 from braddr@puremagic.com  2007-06-18 02:22 -------
http://www.digitalmars.com/d/changelog.html
The 2.000 block ought to have the line referring to the new feature linked to
the description page.


-- 

June 18, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1273


deewiant@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |deewiant@gmail.com
           Keywords|                            |spec
         OS/Version|Windows                     |All
           Platform|PC                          |All




------- Comment #3 from deewiant@gmail.com  2007-06-18 03:37 -------
Under "Final Storage Class", a struct has a constructor, which is invalid code.


-- 

June 18, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1273





------- Comment #4 from braddr@puremagic.com  2007-06-18 03:42 -------
(In reply to comment #3)
> Under "Final Storage Class", a struct has a constructor, which is invalid code.

Let's just call that a sneak preview. :)


-- 

June 18, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1273

the doc quotes following code to be valid:

int foo(int f) { return f * 3; }
invariant int z = foo(2) + 1;

<- Error: cannot evaluate foo(2) at compile time
but the compiler does not
June 18, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1273





------- Comment #6 from deewiant@gmail.com  2007-06-18 07:42 -------
It works at global scope, or if foo() is made static:

void main() {
        static int foo(int f) { return f * 3; }
        invariant int z = foo(2) + 1;
}

int foo(int f) { return f * 3; }
invariant int z = foo(2) + 1;


-- 

June 19, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1273





------- Comment #7 from kamm@incasoftware.de  2007-06-19 07:36 -------
The final const invariant page gives this example:

invariant(int) y;
y = 3;        // ok
auto q = &y;  // q's type is invariant(int)*
*q = 4;       // error, invariant

But the line marked as an error compiles fine. Additionally:

static if(is(typeof(y) == int)) // this passes
  pragma(msg, "y is of type int");
static if(is(invariant(int) == int)) // but this doesn't
  pragma(msg, "invariant(int) is same as int");
static if(is(typeof(q) == int*)) // this passes again
  pragma(msg, "&y is of type int*");

Something else, but related
static if(is(invariant int == invariant(int))) // passes too, though they're
different


-- 

January 22, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=1273


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |WONTFIX


--- Comment #8 from Walter Bright <bugzilla@digitalmars.com> 2012-01-21 16:50:36 PST ---
That page has been dropped.

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