angular icon indicating copy to clipboard operation
angular copied to clipboard

Cannot build when a method name is a keyword and has generic parameters

Open JackHerring opened this issue 9 years ago • 1 comments

When build the following code with pub build with sdk 1.24.2

import 'package:angular/angular.dart';

void main() {
  bootstrap(AppComponent);
}

@Component(selector: "my-app", template: "<h1>#Epic Fail</h1>")
class AppComponent{
  void set<T>(){}
}

the following error occurs

Working dir: C:\Users\Jack\WebstormProjects\untitled2
"C:\Program Files\Dart\dart-sdk\bin\pub.bat" build --mode=debug --output=build
Loading source assets...
Loading angular transformers...
Building untitled2...
[Info from Dart2JS]:
Compiling untitled2|web/main.dart...
[Error from Dart2JS]:
web\main.dart:13:3:
Unexpected token 'void'.
  void set<T>(){}
  ^^^^
Build failed.
[Info from Dart2JS]:
Took 0:00:04.792994 to compile untitled2|web/main.dart.
Process finished with exit code 65

We tried it with various keywords and they all have the same issue.

FYI. @jrote1

JackHerring avatar Aug 16 '17 12:08 JackHerring

This isn't an angular issue - appears to be a problem with Dart2JS. I re-reported the issue at https://github.com/dart-lang/sdk/issues/30457

natebosch avatar Aug 16 '17 16:08 natebosch