http://d.puremagic.com/issues/show_bug.cgi?id=4434


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Mac OS X                    |All


--- Comment #2 from Don <clugd...@yahoo.com.au> 2010-08-11 00:51:57 PDT ---
This has to be a bug either in the parser, or in the type transitivity check.

I've added this line to check that the type being passed to the
AliasDeclaration is correctly constructed. This test fails for the cases which
work!!
---------
parse.c, 2335. Parser::parseBasicType()

        case TOKconst:
            // const(type)
            nextToken();
            check(TOKlparen);
            t = parseType();
            check(TOKrparen);
            if (t->isShared())
                t = t->makeSharedConst();
            else
                t = t->makeConst();
+            t->check();
            break;
---------

// This test case compiles OK, but it fails the check above.
alias int MyInt;
typedef const (MyInt*) MyConstInt;

It's checking that const(MyInt*) is the same as const(const(MyInt)*) -- but
it's isn't!

So really, the difference between the cases that work, and those which fail, is
simply that the latter are checked. The only cases that pass everything are
ones like:  alias const int* XXX;
So either, makeConst() is wrong, or else AliasDeclaration is calling check()
too early; or the check is wrong. I really don't know which it is.

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

Reply via email to