dart-archive / angular.dart

Legacy source repository. See github.com/dart-lang/angular
https://webdev.dartlang.org/angular/
1.24k stars 248 forks source link

Duplicate map keys when multiple @Component annotations on the same class #1733

Closed natebosch closed 7 years ago

natebosch commented 8 years ago

In the generated file _static_type_to_uri_mapper.dart a map gets created which can end up multiple keys with the same name. This causes a warning when the analyzer runs. I traced this to a case where we have multiple component annotations on the same class, but I have not created a repro case to ensure that is a sufficient condition.

Both lines are identical so it should be easy enough to solve by avoiding duplicate keys somewhere around here: https://github.com/angular/angular.dart/blob/master/lib/tools/transformer/type_relative_uri_generator.dart#L71