MantisBT - Ecere SDK
View Issue Details
0000307Ecere SDKcompilerpublic2010-01-18 00:062014-08-08 18:17
sacrebleu 
jerome 
immediatemajoralways
closedfixed 
0.44.09 
0.44.10 640.44.10 64 
0000307: The eC compiler fails to tell you when you reference a class that does not exist.
Class A {
 B a;
};

should break in the compiler with error message:
"Warning: 02:demo.ec "B" referenced but does not exist as Class, Struct or type;"
v0.44d2
Issue History
2010-01-18 00:06sacrebleuNew Issue
2010-01-18 00:06sacrebleuStatusnew => assigned
2010-01-18 00:06sacrebleuAssigned To => jerome
2010-01-18 04:53jeromePriorityurgent => immediate
2010-04-11 04:08sacrebleuNote Added: 0000160
2010-07-07 02:37redjTarget Version => 0.44d2
2010-07-07 04:10redjTag Attached: v0.44d2
2010-07-25 20:38redjRelationship addedchild of 0000429
2010-07-26 01:43jeromeNote Added: 0000227
2010-07-26 01:44jeromeSummaryIDE fails to tell you when you reference a class that does not exist. => The eC compiler fails to tell you when you reference a class that does not exist.
2010-07-26 19:10thexa4Target Version0.44d2 => 0.44 draft 2
2012-03-08 15:41redjTarget Versionold 0.44.pre2 => 0.45 Ginkakuji
2012-03-08 17:18redjRelationship deletedchild of 0000429
2012-03-29 07:52redjCategory => ide
2012-03-29 07:52redjProject@3@ => Ecere SDK
2013-04-24 20:36jeromeStatusassigned => new
2013-04-24 20:37jeromeAssigned Tojerome =>
2013-04-26 18:28jeromeTarget Version0.45 Ginkakuji => 0.44.8 Silver
2013-05-04 00:12jeromeNote Added: 0000784
2013-05-04 00:12jeromeCategoryide => compiler
2013-05-04 00:12jeromeTarget Version0.44.8 Silver => 0.44.1 64
2013-09-10 19:10jeromeTarget Version0.44.12 Fixes => 0.46 eC II
2013-09-10 19:24sacrebleuNote Added: 0001060
2013-09-10 20:58jeromeNote Added: 0001061
2013-09-10 21:19sacrebleuNote Added: 0001062
2013-09-10 21:24jeromeNote Added: 0001063
2013-09-10 23:40sacrebleuNote Added: 0001064
2013-09-10 23:47jeromeNote Added: 0001065
2014-05-31 16:21jeromeAssigned To => jerome
2014-05-31 16:21jeromeStatusnew => assigned
2014-05-31 16:21jeromeProjectionnone => minor fix
2014-05-31 16:21jeromeETAnone => < 1 week
2014-05-31 16:21jeromeProduct Version => 0.44.09
2014-05-31 16:21jeromeTarget Version0.46 eC II => 0.44.10 64
2014-07-05 09:03jeromeNote Added: 0001352
2014-07-05 09:03jeromeStatusassigned => resolved
2014-07-05 09:03jeromeFixed in Version => 0.44.10 64
2014-07-05 09:03jeromeResolutionopen => fixed
2014-08-08 18:17jeromeStatusresolved => closed

Notes
(0000160)
sacrebleu   
2010-04-11 04:08   
Reminder sent to: jerome

To be completed as soon as possible (we discussed this yesterday)
(0000227)
jerome   
2010-07-26 01:43   
The original reason why a never defined class was still handled as a class was for
a) guessing right in the precompiling phase
b) handling classes that would be defined later on in an injected dynamic module

To handle the latter, we should require at least a forward declaration, e.g.:

class MyClass;

For the former, an error or at least a warning should be generated in the Compiling phase.
Major time waster: fix for D2.
(0000784)
jerome   
2013-05-04 00:12   
Produce an error if neither compile-time imported nor forward declared
(0001060)
sacrebleu   
2013-09-10 19:24   
forward declaration = lame
(0001061)
jerome   
2013-09-10 20:58   
Herb:

This would be required only for classes that are not within your project at all, but declared in e.g. a dynamically loaded plugin.

Requiring the forward declaration in this specific case would otherwise let you warn about non-existing classes, which was your complaint here.

Glad to see you still around :) How are ya?
(0001062)
sacrebleu   
2013-09-10 21:19   
I'm always available here-> http://8bitmush.org [^]
Still underemployed

why not use import class Blah; instead of 'forward declaration'?
(0001063)
jerome   
2013-09-10 21:24   
Well:

class Blah;

vs

import class Blah;

Looks quite similar to me :)
And import has a precise meaning of importing either an eC file or a .dll/.so eC shared library module.
(0001064)
sacrebleu   
2013-09-10 23:40   
I'm against this because it creates more work for the programmer and is superfluous. However, compile times are an issue. extern class Blah; ? Since this is specifically for external things


re: overuse of term 'import'

The term import simply means to 'bring in', regardless of how it is used this is a perfect example of how the term can be broadened to include similar features such as noting an external class found in a DLL/plugin
(0001065)
jerome   
2013-09-10 23:47   
class Blah;

would *only* be required for noting the class does exist and will later be imported (note the nuance here, the class is not 'yet' imported)

extern class Blah; // this would be just the same as class Blah

Both actually work already.
(0001352)
jerome   
2014-07-05 09:03   
Fixed by:
https://github.com/ecere/ecere-sdk/commit/fa765a838029ec71a86787e95ebcab5fda0aae1e [^]