fix: prevent local variables from being in scope during their own initializer

This commit is contained in:
Bob Nystrom
2015-04-01 14:05:40 +00:00
parent 07de6fca9e
commit 0cdbe8bc5a
6 changed files with 30 additions and 25 deletions
@@ -1,2 +1 @@
var a = a == null
IO.print(a) // expect: true
var a = a == null // expect error
@@ -1,4 +1,3 @@
// skip: Variables should not be in scope in their initializer.
{
var a = a + 1 // expect error
IO.print(a)
@@ -1,4 +1,3 @@
// skip: Variables should not be in scope in their initializer.
{
var a = "outer"
{