Types & variable time mismatch

Archives Forums/Blitz3D Bug Reports/Types & variable time mismatch

WildStorm(Posted 2005) [#1]
just try this:

type asd
 field a%
end type

asd.asd = new asd

asd\a$ = "asd"

here comes NO compiler error!

but here:
a% = 1
a$ = "asd"

the compiler gives us a error.

plz fix it, sometimes it just sucks because you search for days for a b ug in your code ;)


Fernhout(Posted 2005) [#2]
I did questioned about this to. And the awnser i simple. If you declared a variable say 'a' and you make it a integer, its not possilble to make the same variable and give it another declaration say's STRING. One Variable can not have two declarations at the same time. So if you make one you can't use it for something else than that you made it for.


KuRiX(Posted 2005) [#3]
WildStorm is talking about a problem where the check is not made. In this case, with types there is no checking!


Damien Sturdy(Posted 2005) [#4]
interesting!!!!


big10p(Posted 2005) [#5]
I've come across this before but can't remember what the explanation was. :)


Fernhout(Posted 2005) [#6]
For a type its simple Every type gets its own pointer. So every new type is a NEW type. And get its own memory part. So there can be more type whit the same name.


Koriolis(Posted 2005) [#7]
Ahem Fernhout, are you sure you did read the orginal post? Or did you post in the wrong thread?


big10p(Posted 2005) [#8]
hehe I didn't understand a word of that, either. :P


Damien Sturdy(Posted 2005) [#9]
i get what he's trying to say- but its wrong :)

Each new type crates a new instance with a new \a field.

each \a could be a % or a #, or, a $.


Thats what he was trying to say- It's wrong though :)


Fernhout(Posted 2005) [#10]
Sorry guy's i wasn't paying attention. I did take a good look what he was writing. And he's right the compiler must give a error massage.