Re: [Vala] vala code generation too constrained?



On Tue, Jan 11, 2011 at 20:55:21 +0100, Jürg Billeter wrote:
On Tue, 2011-01-11 at 11:11 +0100, Xavier Bestel wrote:
IMHO there should be 2 modes:
- library mode, where conflicts are clearly and loudly shown by valac.
- application mode, where conflicts are silently resolved via a suffix
  or whatever clever magic some smart people invent.

The main reason that speaks against this, in my opinion, is that it
would be really confusing if your code stops working when you move it
from an application to a library, which is not that rare. Also, while C
identifier conflicts due to simple name mangling can lead to unexpected
error messages from the C compiler, they are usually really easy to work
around.

It would be nice if vala produced the error itself when a name is emited
again for different object rather than waiting for the C compiler to do so.
Something like:

    error: Symbol generated for method 'X.Y.z' conflicts with symbol generated
    for class 'X.Y.Z'. Rename one of the objects or assign different C names
    to them via [CCode] attribute.

Handling it would be much more complicated and introduce new corner cases
with their own strange errors and would generally not be worth it.

-- 
                                                 Jan 'Bulb' Hudec <bulb ucw cz>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]