www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2522] New: Combining two types

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

           Summary: Combining two types
           Product: D
           Version: 1.038
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: spec
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: aziz.kerim gmail.com


What is the correct way to unify the types of two operands of a binary
operator? The specs talk here and there a little bit about rules for implicit
conversions, but that doesn't really tell me much about how to implement this
stuff in my own compiler.

I'd love to have a detailed guide for how to actually do semantic analysis in a
D compiler. There really need to be documents that explain the D language with
actual compiler writers in mind. I have seen such a thing for Java some time
ago on the web. I would've given a link, but I don't remember anymore where I
saw it.
Perhaps somebody, who knows the front-end well, could help you out on typing up
these kind of documents? A sort of collaborative project using a wiki system?

Most of the time I simply have no clue what to do, SA is darn complex. :(


-- 
Dec 17 2008
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2522






could you give an example of what you want?

If you want "What is the type of `int + long`?" take a look at typeof().

If that is what you are looking for, where would you expect to see that info?


-- 
Dec 17 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2522






I think, arithmetic in D is the same as in C.


-- 
Dec 18 2008
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2522


Walter Bright <bugzilla digitalmars.com> changed:

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



21:14:05 PST ---
It depends on which binary operator, as they have behaviors custom to what they
are supposed to do. If the spec is incomplete on a particular operator, please
point that out. In the meantime, this bug report is a bit too vague to be
actionable.

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