.net - Numbers in namespace -


i have bunch of classes under these 4 different namespaces:

  • a.b.c.x
  • a.b.c.y
  • a.b.c.z

neither of classes contain definition "myenum" directly under namespace "a.b". have "myenum" defined in "a.b.c.x" , "a.b.c.z" following error:

the namespace 'a.b' contains definition myenum.

why this? , how can fix it?

edit:

well fixed it. apparently cannot have numbers "a.b.202.x" in namespace. that's complaining about. know why?

apparently cannot have numbers "a.b.202.x" in namespace. that's complaining about. know why?

the same reason can't declare int 202; - identifiers cannot begin digits in c#.

edit:

here's attempt explain specific (strange) compiler error, reproducing it.

the following code:

namespace a.b {     enum myenum {} }       namespace a.b.202.x {    enum myenum {} } 

fails curious (to me anyway) errors:

{ expected   namespace 'a.b' contains definition 'myenum'   

i speculate reason bad identifier makes compiler treat second namespace declaration "malformed", ignoring .202.x. if so, follows should indeed appear compiler second myenum type in namespace a.b, of course duplicate.

this further supported fact if rid of first namespace (and enum in it) , recompile, see qualified name of second enum-type inferred a.b.myenum (despite failure compile).

enter image description here


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -