Skip to content

incorrect variable resolving for class default initializer #2790

@HerrCai0907

Description

@HerrCai0907

Bug description

incorrect variable resolving.

let a = 10;
class A {
  v: i32 = a;
  constructor(a: f64) {}
}

new A(1.0);
ERROR AS200: Conversion from type 'f64' to 'i32' requires an explicit cast.
   :
 3 │ v: i32 = a;~
   └─ in assembly/index.ts(3,12)

Steps to reproduce

npm run asbuild

AssemblyScript version

latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions