Thread overview
[Issue 2522] New: Combining two types
Dec 18, 2008
d-bugmail
Dec 18, 2008
d-bugmail
Dec 18, 2008
d-bugmail
Jan 23, 2012
Walter Bright
December 18, 2008
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. :(


-- 

December 18, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2522





------- Comment #1 from shro8822@vandals.uidaho.edu  2008-12-17 19:19 -------
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?


-- 

December 18, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2522





------- Comment #2 from maxmo@pochta.ru  2008-12-18 03:56 -------
I think, arithmetic in D is the same as in C.


-- 

January 23, 2012
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


--- Comment #3 from Walter Bright <bugzilla@digitalmars.com> 2012-01-22 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: -------