www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2843] New: ICE with is-expression with invalid dot-expression in is-expression involving typeid expression

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2843

           Summary: ICE with is-expression with invalid dot-expression in
                    is-expression involving typeid expression
           Product: D
           Version: 2.027
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: dhasenan gmail.com


foo.bar is typeid(int);

Error message:
bug.d(3): Error: undefined identifier foo
bug.d(3): Error: no property 'bar' for type 'int'
bug.d(3): Error: incompatible types for ((1) is (&_D10TypeInfo_i6__initZ)):
'int' and 'object.TypeInfo'
bug.d(3): Error: is has no effect in expression (1 is &_D10TypeInfo_i6__initZ)
dmd: constfold.c:863: Expression* Identity(TOK, Type*, Expression*,
Expression*): Assertion `0' failed.
Aborted

Thankfully, it gives you the full error message first.


-- 
Apr 16 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2843


clugdbug yahoo.com.au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch




------- Comment #1 from clugdbug yahoo.com.au  2009-05-05 10:43 -------
Reduced test case:

bool b = 1 is typeid(int);

This has the same root cause as 1524 (only cases where both are the same type
were considered), but it's the case where one expression is a typeid, and the
other is const.

In constfold.c, line 861:
OLD:
        }else
        assert(0);
NEW:
        }else if (e1->isConst() && e2->isConst()) {
        // Comparing a SymExp with a literal, eg typeid(int) is 7.1;
           cmp=0; // An error has already occured. Prevent an ICE.
        }else
        assert(0);


-- 
May 05 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2843


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #2 from Walter Bright <bugzilla digitalmars.com>  2009-07-09
02:47:54 PDT ---
Fixed dmd 1.046 and 2.031

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