interface A
{
}
class B : A
{
}
#include "file1.as" // inclusion handled by CScriptBuilder (metadata OFF)
class C : B
{
}
void main()
{
A @a = C();
}
interface A
{
}
class B : A
{
}
#include "file1.as" // inclusion handled by CScriptBuilder (metadata OFF)
class C : B
{
}
void main()
{
A @a = C();
}
Quote: Original post by Zeu5
As I learned from the documentation all the script sections added to a module with AddScriptSection() will be treated as if one large script, where all declarations are visible to every section, no matter in which order the sections are added to the module. Is this assumption correct?
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
void asCBuilder::CompileClasses(){ .... // Determine class inheritances and interfaces for( n = 0; n < classDeclarations.GetLength(); n++ ) { ... // Find the base class that this class inherits from bool multipleInheritance = false; asCScriptNode *node = decl->node->firstChild->next; while( node && node->nodeType == snIdentifier ) { .... if( !error ) { decl->objType->derivedFrom = objType; objType->AddRef(); Remove this --> // The derived class inherits all interfaces from the base class for( unsigned int n = 0; n < objType->interfaces.GetLength(); n++ ) { if( !decl->objType->Implements(objType->interfaces[n]) ) { decl->objType->interfaces.PushLast(objType->interfaces[n]); } else { // Warn if derived class already implements the interface int r, c; file->ConvertPosToRowCol(node->tokenPos, &r, &c); asCString msg; msg.Format(TXT_INTERFACE_s_ALREADY_IMPLEMENTED, objType->interfaces[n]->GetName()); WriteWarning(file->name.AddressOf(), msg.AddressOf(), r, c); } } <-- Remove this .... // Go through each of the classes and register the object type descriptions for( n = 0; n < classDeclarations.GetLength(); n++ ) { sClassDeclaration *decl = classDeclarations[n]; // Add all properties and methods from the base class if( decl->objType->derivedFrom ) { // TODO: Need to check for name conflict with new class methods asCObjectType *baseType = decl->objType->derivedFrom; Add this --> // The derived class inherits all interfaces from the base class for( unsigned int n = 0; n < baseType->interfaces.GetLength(); n++ ) { if( !decl->objType->Implements(baseType->interfaces[n]) ) { decl->objType->interfaces.PushLast(baseType->interfaces[n]); } else { // Warn if derived class already implements the interface int r, c; decl->script->ConvertPosToRowCol(decl->node->tokenPos, &r, &c); asCString msg; msg.Format(TXT_INTERFACE_s_ALREADY_IMPLEMENTED, baseType->interfaces[n]->GetName()); WriteWarning(decl->script->name.AddressOf(), msg.AddressOf(), r, c); } } <-- Add this
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game