User Tools

Site Tools


naming_conflicts

Naming conflicts

Unfortunately, the .NET runtime is very sensitive to any naming conflicts, and X# is more accurate than Vulcan.NET. So these rules apply:

  • No class in your application can have the same name as your application itself. So if your application (exe or dll) is has a name of MyClass, you cannot have a class MyClass in your application. If you cannot change the name of your class, change the name of your application to app.MyClass or something similar
  • your application cannot have the same name as any of the VO runtime methods. Otherwise you will have to call the function fully qualified:
cString := VulcanRTFuncs.Functions.Substr( "Hello X#", 1, 2 )

The relative error is

error XS0118: 'Substr' is a namespace but is used like a variable
  • you cannot have a method and a access/assign with the same name. Since access/assign does not exist in the .NET runtime, the X# compiler translates access/assign to property. And .NET does not allow a property and a method with the same name name in one class
  • The Vulcan compiler has not problem when two functions of the same name exists in different assemblies: it takes one of them, and you cannot define which. The X# compiler is more precise and does not allow this.
naming_conflicts.txt · Last modified: 2018/02/18 05:53 by wolfgangriedmann