Re: ver 4.0 builtin_chosen_warning ???
- Posted by CChris Sep 06, 2008
- 987 views
bernie said...
mattlewis said...
bernie said...
Why doesn't the message just say: Namespace Conflict: Program has declared compare() with the name as function in D:\#EU40\INCLUDE\std/map.e
Is that meant to be an error? It's not clear from what you posted. I don't think that it should be.
Matt
Matt: Yes I'am saying that ' builtin_chosen_warning ' should be dumped. The way it reads is confusing. I sounds like it is choosing an option for you and hitting return will continue your program which is not true. Namespace errors should all fall under one class of error. Namespace Conflict Error: This forces users to learn the proper use of the namespace features. Bernie
But it is not an error at all.
It is perfectly ok to define a routine with the same name as a builtin, and so was it in 3.1.
What has changed is that there are two ways:
- using global/public/export. Then the routine is not supposed to shadow the built-in. It was assumed (I don't agree with this opinion) that it would be confusing to have the interpreter silently choose the built-in, which it should do, so there is a warning enabled by default.
- using override. This shadows the builtin, just like in 3.1.
Again, you may consider this not to be relevant, and can disable the warning.
CChris