Reputation: 5705
I have the following file race.dart
// Copyright (c) 2015
@export
@jsonObject
@ValidIf( _isRaceValid, customDescription: '$invalidStr Race' )
class Race extends Object
with JsProxy, Exportable {
@export
@jsonProperty
@reflectable
@ValidIf( isRequiredNounValid, customDescription: 'invalid noun' )
@NotEmpty( )
@Length( min: 2 )
String race = '';
@export
@jsonProperty
@reflectable
@ValidIf( isOptionalNounValid, customDescription: 'Invalid nound' )
String ethnicGroup = '';
@export
@jsonProperty
bool isValid = false;
}
bool _isRaceValid( Race r ) {
if (( r.race.length >= 2 ) &&
(r.ethnicGroup.isEmpty )) {
return r.isValid = true;
}
else {
return r.isValid = false;
}
}
name: epimss_polymer_reg
description: A starting point for Dart libraries or applications.
version: 0.0.1
author: zoong <[email protected]>
#homepage: https://www.example.com
environment:
sdk: '>=1.8.3 <2.0.0'
dependencies:
#async_commands: ^0.2.5
bwu_fontawesome_iconset_svg: ^0.3.0-1
drails_validator: ^0.0.1
exportable: ^0.1.0
jsonx: ^2.0.1
polymer_elements: ^1.0.0-rc.1
polymer: ^1.0.0-rc.2
reflectable: ^0.3.1
validator: ^0.0.4
web_components: ^0.12.0
dependency_overrides:
drails_commons: '0.0.6'
logging: '0.11.2'
dev_dependencies:
test: ^0.12.0
When I attempt to run my application (index.html) the follow error is displayed by pub serve
Cannot handle private identifier _isRaceValid
[Error from Reflectable on epimss_polymer_app|ReflectableTransformed]:
I see that reflectable 0.3.3 that I am using give some info about private identifiers at https://pub.dartlang.org/packages/reflectable
Any help will be appreciated.
Thanks
I did as you suggested Gunter. Now I see on hint of errors in the DartAnalysis or any where. But the application now runs, displays a blank page and shows no output errors.
My index.dart is
import 'package:bwu_fontawesome_iconset_svg/bwu_fontawesome_iconset_svg.dart';
import 'package:epimss_polymer_app/main_app.dart';
import 'package:polymer/polymer.dart';
/// [MainApp] used!
main() async {
await initPolymer();
}
When I run the application with debug I get the following:
Observatory listening at http://127.0.0.1:63906/ Internal error: 'http://localhost:63342/epimss_polymer_app/web/index.dart': error: line 40 pos 2016: expression is not a valid compile-time constant final _data = {const prefix0.JsProxyReflectable(): new r.ReflectorData([new r.ClassMirrorImpl(r"PolymerMixin", r"polymer.src.common.polymer_js_proxy.PolymerMixin", 519, 0, const prefix0.JsProxyReflectable(), const [], const [], const [], -1, {}, {}, const {}, -1, 0, const [], const [prefix0.jsProxyReflectable]), new r.ClassMirrorImpl(r"JsProxy", r"polymer.lib.src.common.js_proxy.JsProxy", 519, 1, const prefix0.JsProxyReflectable(), const [], const [], const [], -1, {}, {}, const {}, -1, 1, const [], const [prefix0.jsProxyReflectable]), new r.ClassMirrorImpl(r"dart.dom.html.HtmlElement with polymer.src.common.polymer_js_proxy.PolymerMixin", r"polymer.lib.polymer_micro.dart.dom.html.HtmlElement with polymer.src.common.polymer_js_proxy.PolymerMixin", 583, 2, const prefix0.JsProxyReflectable(), const [], const [173, 174, 175], const [], -1, const {}, const {}, const {}, -1, 0, const [], const []), new r.ClassMirrorImpl(r"PolymerSerialize", r"polymer.src.common.polymer_serialize.PolymerSerialize", 519, 3, const prefix0.JsProxyReflectable(), const [176, 177], const [176, 177], const [], -1, {}, {}, const {}, -1, 3, const [0], const []), new r.ClassMirrorImpl(r"dart.core.Object with polymer.lib.src.common.js_proxy.JsProxy", r"epimss_polymer_shared.data.dart.core.Object with polymer.lib.src.common.js_proxy.JsProxy", 583, 4, const prefix0.JsProxyReflectable(), const [], const [], const [], -1, const {}, const {}, const {}, -1, 1, const [], const []), new r.ClassMirrorImpl(r"ClinicalFeature", r"epimss_polymer_shared.data.ClinicalFeature", 7, 5, const prefix0.JsProxyReflectable(), const [0, 1, 2, 3, 4, 5, 6], const [178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191], const [], 1, {}, {}, {}, -1, 5, const [], const [prefix12.jsonObject, const prefix13.ValidIf(prefix4.isClinicalFeatureValid, customDescription: 'ClinicalFeature $invalidStr')]), new r.ClassMirrorImpl(r"WebOptions",
... a whole lot more of similar output (over 140,000) characters.
What does this all means?
name: epimss_polymer_app
version: 0.0.1
description: A web app built using polymer.dart.
author:
#homepage: https://www.example.com
environment:
sdk: '>=1.9.0 <2.0.0'
dependencies:
browser: ^0.10.0
bwu_fontawesome_iconset_svg: ^0.3.0-1
epimss_polymer_reg:
path: J:/workspace/epimss/dart/epimss_polymer_reg
epimss_polymer_shared:
path: J:/workspace/epimss/dart/epimss_polymer_shared
epimss_shared_core:
path: J:/workspace/epimss/dart/epimss_shared_core
polymer_elements: ^1.0.0-rc.1
polymer: ^1.0.0-rc.2
reflectable: ^0.3.1
web_components: ^0.12.0
dependency_overrides:
drails_commons: '0.0.6'
logging: '0.11.2'
dev_dependencies:
test: ^0.12.5
transformers:
- web_components:
entry_points: web/index.html
- reflectable:
entry_points: web/index.dart
- $dart2js:
$include: '**/*.bootstrap.initialize.dart'
minify: true
commandLineOptions:
- --trust-type-annotations
- --trust-primitives
- test/pub_serve:
$include: test/**_test{.*,}.dart
Upvotes: 2
Views: 43
Reputation: 657058
dart:mirrors
and reflectable can't access private members.
To fix it you need to make _isRaceValid
public.
Upvotes: 1