01-07-2005, 01:32 PM
Quote:Yeah, arguments were not checked if they were passed by reference, FB was converting anything to temp vars, new version won't allow that, (a) is a byref integer arg, while you are passing a byte var, new version will report:
test.bas(10) : error 59: Type mismatch, at parameter: 1
So or you redeclare it as (byval a as integer) or (a as byte).
New version does loads of parameter checkings that weren't done before, i was checking stuff at the Intermediate Representation module, what is a bad place to do that.. all checks done at the AST now.
New release will be done soon..
I'm kinda confused... Will we be bale to pass args like this?
Code:
DEFINT A-Z
declare Sub addone(NewA() as Integer)
type mytypeT
a(0 to 3) as Integer
end type
dim mytype(1 to 100) as mytypeT
for i = 1 to 5
addone mytype(i).a()
next i
For i = 1 to 5
For id=0 to 3
Print MyType(i).a(id)
Next
Next
sleep
SUB addone(NewA() as Integer)
For id = 0 to 3
NewA(id)= 1 + Int(rnd*10)
next
end SUB