fix: prevent local variables from being in scope during their own initializer
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
var A = A == null
|
||||
IO.print(A) // expect: true
|
||||
@@ -0,0 +1,2 @@
|
||||
var A
|
||||
IO.print(A) // expect: null
|
||||
@@ -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"
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user