list of dots Digital Research Alliance of Canada logo  NSERC logo  University of Ottawa logo / UniversitĂ© d'Ottawa

User Manual    [Previous]   [Next]   

W030 Redefined Namespace

Umple semantic warning reported when a class is declared in separate places to be in two namespaces

Since a class can only be in one namespace, the last namespace declaration overides earlier ones. This can sometimes be useful, e.g. when creating a mixin to change the default location of a class. However, it is normally a sign of a mistake, hence the warning.

Example

// This example generates the message
// Namespace b, encountered later, will
// be the namespace of the class
namespace a;

class X30redefnamespace {
}

namespace b;

class X30redefnamespace {
}
      

Load the above code into UmpleOnline