Skip to content

Broken use before init in constructors #458

Description

@tjpalmer

New constructor validation might help this, but here's a problem today:

$ export class Test {
      public x: Float64;
      public y: Float64;
      public constructor() {}
    }
interactive#10: Test
$ export class Test {
      public x: Float64;
      public y: Float64;
    }
2: public x: Float64;
          
[interactive#11:2+11-12]@S: Property x not initialized in constructor
3: public y: Float64;
          
[interactive#11:3+11-12]@S: Property y not initialized in constructor
interactive#11: Test

The errors in the latter case are correct and also should be applied to the earlier case.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions