Skip to content

Watch mode errors on scope changes after transpilation #1613

@luis-j-soares

Description

@luis-j-soares

There's an issue with watch mode where field initialisers will trigger diagnostic errors after their scope is transpiled. This only happens after the app has already been transpiled.

Here's a unit test that shows the issue:

it('does not pollute the AST after validation', () => {
    const file = program.setFile<BrsFile>('source/lib.bs', `
        class HasPropertyInitialiser
            name as string = createObject("roString")
            sub new()
                super()
            end sub
        end class
    `);
    program.validate();
    file.transpile();
    program.setFile<BrsFile>('source/another.bs', `
        class AnotherClassJustToInvalidateScope
        end class
    `);
    program.validate();
    expectZeroDiagnostics(program.getDiagnostics());
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions