Skip to content
This repository has been archived by the owner on Jan 20, 2018. It is now read-only.

Support private constants in intializer constructors #29

Closed
donny-dont opened this issue Mar 10, 2015 · 7 comments · Fixed by #34
Closed

Support private constants in intializer constructors #29

donny-dont opened this issue Mar 10, 2015 · 7 comments · Fixed by #34

Comments

@donny-dont
Copy link

Currently the transformer does not support private constants in intializer constructors.

The following used to work when creating a PolymerElement.

const String _tagName = 'my-element';

@CustomTag(_tagName)
class MyElement extends PolymerElement {
  static const customTagName = _tagName;
}

Would be great to get that functionality back.

@jakemac53
Copy link
Contributor

This should work now, it should just resolve the constant and inline it in the bootstrap file.

@donny-dont
Copy link
Author

Great! I'll verify it whenever a new version of Polymer.dart lands.

Thanks again!

@jakemac53
Copy link
Contributor

it should actually work today - this was added a couple weeks ago I just forgot to close the bug :)

@donny-dont
Copy link
Author

Still getting the error. This is on Dart Editor version 1.10.0.dev_00_01 (DEV), Dart SDK version 1.10.0-dev.0.1

--- 11:27:04 AM Starting pub serve :  ---
Loading source assets...
Loading polymer transformers...
Serving rei web on http://localhost:8080
[Error from polymer (PolymerBootstrapTransformer) on rei|web/selection_visualizer/index.html]:
Private constants are not supported in intializer constructors, found get _tagName → String.
Build completed with 1 errors.
[web] GET /selection_visualizer/index.html => Could not find asset rei|web/selection_visualizer/index.html.
[web] GET /favicon.ico => Could not find asset rei|web/favicon.ico.

--- 11:27:36 AM Running pub upgrade on  ... ---
Resolving dependencies...
  analyzer 0.24.0 (0.25.0-dev.3 available)
  args 0.12.2+6 (0.13.0 available)
  barback 0.15.2+4
  browser 0.10.0+2
  cli_util 0.0.1+1
  code_transformers 0.2.7+2
  collection 1.1.0
  csslib 0.11.0+4
  dart_style 0.1.7
  glob 1.0.4
  html 0.12.1
  html5lib 0.12.1
  initialize 0.6.0+1
  logging 0.9.3
  matcher 0.11.4+4 (0.12.0-alpha.0 available)
  mock 0.11.0+2
  observe 0.13.0+1
  path 1.3.4
  polymer 0.16.0+7
  polymer_expressions 0.13.1
  pool 1.0.1
  smoke 0.3.2
  source_maps 0.10.0+2
  source_span 1.1.1
  stack_trace 1.2.4
  string_scanner 0.1.3+1
  template_binding 0.14.0+2
  unittest 0.11.5+4 (0.12.0-beta.1 available)
  utf 0.9.0+2
  watcher 0.9.5
  web_components 0.11.1+1
  when 0.2.0
  which 0.1.3
  yaml 2.1.2
No dependencies changed.

@jakemac53
Copy link
Contributor

Yep, you are right. I could have sworn I fixed this but I must be taking crazy pills.

@jakemac53
Copy link
Contributor

published 0.6.0+2 of the initialize to fix this, please try again :)

@donny-dont
Copy link
Author

Works for me 👍

Thanks for getting this fixed!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
2 participants