--- Comment #6 from Steven Schveighoffer <> 2010-09-20 
06:03:43 PDT ---
(In reply to comment #5)
> > Why should the D compiler refuse to compile them?
> The D compiler has to disallow or warn against common traps.

But opCmp is a valid function!  I can still call it, even though it's not put
into the typeinfo.

> > This is probably a job for a lint-type tool.
> If some bug may be found at compile-time and it's not too much hard to find it
> (example: it doesn't require flow analysis), then in my opinion it's a job of
> the (D) compiler to avoid the bug. Clang compiler designers seem to agree with
> me.

But it's not a bug!  opCmp is a valid symbol name for a function, and can be
called with the arguments you specify.  In fact, it even works with the
comparison operators.

There is nothing inherently special about opCmp.  We need to add special
notation conveying our intentions to the compiler (that it should be used in
the TypeInfo).  It's like refusing to compile a function because it's not an
english word.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to