Multiple declarations
Works for me in the RI:
var x = 10; var x = 20; print(x) 20
As it should.
Jeff Dyer wrote:
Works for me in the RI:
var x = 10; var x = 20; print(x) 20
As it should.
Could be an old build? Check one of the snapshots.
Thanks - a new build fixed it.
Michael
Follow up:
The RI allows typed redeclarations providing the type is not double.
This works:
// var x:double = 7 // delete x
var x:boolean = true delete x
var x:string = "there" delete x
var x:boolean = false delete x
var x = false delete x
But uncomment the first declaration and you get:
defining ...
ERROR FixtureError: incompatible redefinition of fixture name: x
(near t.as:1:1-1.3)
I presume this is an RI bug?
Michael
Should be a bug. The rule that's been considered is that redefinition is allowed if the annotations are equal (either missing or the same type).
Is the following valid?
var x = 2 var x = 3
The ES4 RI prevents this. ASC redefines x.
What should this do?
Michael