Skip to content

[Bug] i32 variable instanceof f32 compiles to true #493

@jtenner

Description

@jtenner

When testing my assertion library, I found this gem.

 var i: i32 = 0; log<bool>((i instanceof f32) || (i instanceof f64)); // logs the value 1 in the console

Expected behavior should return false.

As a reference for the assertion that lead me to this issue, I have some lines in my code that check to see if the generic parameter is instanceof a float value.

 it("should throw if value type is not a float", (): void => { expectFn((): void => { expect<i32>(0).toBeCloseTo(0); }).toThrow("integer values should throw on toBeCloseTo assertions"); });

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