Skip to content

Remove expression variant from isInteger, isFloat etc. for consistency #531

Closed
@dcodeIO

Description

@dcodeIO

Currently, most static type evaluation builtins take either a type argument or an argument, but the second case is unsound in that the expression is evaluated for its type but ultimately ignored. For example, the following code will never execute the expression because the call's result is supposed to evaluate to a constant with no place to put the expression:

var a: i32 = 0;
if (isInteger(a = 1)) {
  // a is 0
}
// a is 0

I therefore propose to remove the second case. Or does anyone actually have to use the second case for a good reason, somewhere?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions