Skip to content

[Language] Constants being the same iff equal #3294

@DartBot

Description

@DartBot

This issue was originally filed by [email protected]


Spec ch. 10.1 says:
Let c1 and c2 be a pair of constants. Then c1 === c2 i� c1 == c2.

However, double.NAN and the following example seem to disagree with the above statement:

class C {
  final x;
  const C(this.x);

  // operator equals not supported by the VM yet
  bool operator==(C other) {
    return this.x != other.x;
  }
}

const C(1) != const C(1)
but const C(1) === const C(1)

Metadata

Metadata

Assignees

Labels

area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions