defined() bug

General discussion for topics related to the FreeBASIC project or its community.
Post Reply
Mysoft
Posts: 836
Joined: Jul 28, 2005 13:56
Location: Brazil, Santa Catarina, Indaial (ouch!)
Contact:

defined() bug

Post by Mysoft »

Code: Select all

enum MyEnum
  MyEntry
end enum

'this work
#ifdef MyEnum.MyEntry
  #print " worked"
#endif

'those does not
#ifdef MyEnum.NotMyEntry
  #print " worked"
#endif

#if Defined( MyEnum.NotMyEntry )
  #print " worked"
#endif
error 3: Expected End-of-Line, found '#' in '#print " worked"'
error 7: Expected ')' in '#if Defined( MyEnum.NotMyEntry )'


so seems both #ifdef and defined() throws meaningless errors when queried for existance
it happens when anything that requires a dot (or can optionally accept a dot) like namespace,enum (type is even worse)
ofcourse theres a bunch of similar weakness related to typeof( type.member ) and stuff like that as well
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: defined() bug

Post by fxm »

Yes.
Sounds like a parser issue.
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: defined() bug

Post by fxm »

Post Reply