View Revisions: Issue #768

Summary 0000768: compiler get confused about types in templates and report bad warnings
Revision 2016-07-16 20:45 by jerome
Steps To Reproduce the following code (last line):
            Array<String> * newStrings = (Array<String>*)((byte *)options + option);
            Array<String> * strings = (Array<String>*)((byte *)output + option);
            if(*strings) { strings->Free(); delete *strings; }
            if(*newStrings && newStrings->count) { *strings = { }; strings->Copy(*newStrings); }

gives this warning:
   src/project/ProjectNode.ec:2229:82: warning: incompatible expression *newStrings (ecere::com::Array<String>); expected ecere::com::Container<T>

and this code (last line):
            Array<String> tempStrings = optionTempStrings[option];
            Array<String> * strings = (Array<String>*)((byte *)output + option);
            if(*strings) { strings->Free(); delete *strings; }
            if(tempStrings && tempStrings.count) { *strings = { }; strings->Copy(tempStrings); }

gives this warning:
   src/project/ProjectNode.ec:2238:82: warning: incompatible expression tempStrings (ecere::com::Array<String>); expected ecere::com::Container<T>
Revision 2012-10-29 20:08 by redj
Steps To Reproduce
the following code (last line):
            Array<String> * newStrings = (Array<String>*)((byte *)options + option);
            Array<String> * strings = (Array<String>*)((byte *)output + option);
            if(*strings) { strings->Free(); delete *strings; }
            if(*newStrings && newStrings->count) { *strings = { }; strings->Copy(*newStrings); }

gives this warning:
   src/project/ProjectNode.ec:2229:82: warning: incompatible expression *newStrings (ecere::com::Array<String>); expected ecere::com::Container<T>

and this code (last line):
            Array<String> tempStrings = optionTempStrings[option];
            Array<String> * strings = (Array<String>*)((byte *)output + option);
            if(*strings) { strings->Free(); delete *strings; }
            if(tempStrings && tempStrings.count) { *strings = { }; strings->Copy(tempStrings); }

gives this warning:
   src/project/ProjectNode.ec:2238:82: warning: incompatible expression tempStrings (ecere::com::Array<String>); expected ecere::com::Container<T>