dev_compiler icon indicating copy to clipboard operation
dev_compiler copied to clipboard

No error about duplicate initializers

Open ochafik opened this issue 9 years ago • 3 comments

class Foo {
  var x;
  Foo([this.x]) : this.x = 1;
}

In Dart, this prevents the code from running, but silently ignored by ddc.

ochafik avatar Jun 10 '15 15:06 ochafik

hmmm. Does dartanalyzer find this? We should be displaying all of those errors. I wonder if that reporting got busted somehow. What commands did you use to run DDC?

jmesserly avatar Jun 10 '15 15:06 jmesserly

Ah, dartanalyzer doesn't see this either! I just ran dartdevc -o out test.dart.

ochafik avatar Jun 10 '15 15:06 ochafik

Ah, nice find! Sounds like an analyzer bug ... or maybe a bug that other Dart impls display an error. Not sure, would have to double check spec

jmesserly avatar Jun 10 '15 15:06 jmesserly