[Issue 664] is(func T == function) ignores variadic arguments

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Dec 19 22:44:41 PST 2011


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


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |spec


--- Comment #9 from Don <clugdbug at yahoo.com.au> 2011-12-19 22:44:37 PST ---
(In reply to comment #8)
> (In reply to comment #7)
> > (In reply to comment #6)
> > > How does that solve the problem? The root cause is that is( ==function) assumes
> > > that all of the function parameters can be returned in a tuple, but that isn't
> > > true for ...
> > 
> > In what way does it make that assumption?
> 
> It declares T as a tuple containing all of the function arguments.

Complete section of the spec:
------
6. is ( Type Identifier == TypeSpecialization )

The condition is satisfied if Type is semantically correct and is the same as
TypeSpecialization. The Identifier is declared to be either an alias of the
TypeSpecialization or, if TypeSpecialization is dependent on Identifier, the
deduced type. 

If TypeSpecialization is one of typedef struct union class interface enum
function delegate then the condition is satisifed if Type is one of those.
Furthermore, Identifier is set to be an alias of the type:

keyword     alias type for Identifier
function     TypeTuple of the function parameter types
------
This is impossible if the function has a C-style variadic parameter. Although
solution (2) would allow it to be a Tuple, it wouldnt be a TypeTuple. So a
change to the spec is inevitable.

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


More information about the Digitalmars-d-bugs mailing list