Comments (11)
Thanks! Do you have code which will reproduce the problem? (I couldn't see any references to code at dart-archive/dart-protoc-plugin#51, and I'm not sure git clone https://github.com/dart-lang/dart-protoc-plugin
will do).
from reflectable.dart.
Tried
...$ git clone 'https://github.com/dart-lang/dart-protoc-plugin'
...$ cd dart-protoc-plugin
...$ pub get
...$ pub build --mode=debug test
where the latter produces 14919 lines of diagnostic messages, but it ends in 'Build failed.', none of the messages mention _Readonly
, and the 'build' directory tree is empty, so that wasn't enough.
Could you give some more input on how you can reproduce the problem?
from reflectable.dart.
It took some time to prepare a minimal example: https://github.com/wienczny/ReflectableBugExample
dart-protoc-plugin used is dart-archive/dart-protoc-plugin@58a031c
The bug can be triggered inside the ReflectableBugExample
by running pub build
from reflectable.dart.
Got it, thanks a lot!
from reflectable.dart.
Ah, sorry -- this is a very simple issue: The problem is that there is an attempt to access a private declaration in 'messages.pb.dart' and reflectable does not support access to private declarations.
It is common for Dart tools to react to this situation (access to private declarations across library boundaries) by claiming that the requested name does not exist. The underlying reason is that the private names are renamed such that there is no way to access them (not even with dynamic
invocation).
Couldn't you simply make _ReadonlyEnvelope
public?
from reflectable.dart.
Duplicate of #33.
from reflectable.dart.
If you mean manually modifying all _Readonly*
in the generated code - I could do that.
I just prefer a solution that worked across rebuilds, though.
from reflectable.dart.
And you don't have enough control over that code generation process to avoid the generation of that as a private name in the first place?
For instance, if there is a transformer somewhere which will consistently create this type of problem for many of its users then the maintainer of that transformer might be persuaded to make that change..
from reflectable.dart.
We can sort private classes away when generating the code, I guess that is better than generating invalid code - not all classes might be in the users control to make public.
When sorting away a private member it could be logged with logger.fine so a pub build --verbose would reveal that it happened.
from reflectable.dart.
Reclassified as a bug: I forgot that we are actually generating that private name, which shouldn't happen in any case.
from reflectable.dart.
We're now avoiding to create the expressions that will not compile because they attempt to access a private declaration in a different library (commit 2d9b6f5 on reflectable).
Looking at your explanation again, it looks like the private class was not annotated directly by you, it may instead have been selected by subtype quantification in a reflector that you hadn't even written, and the class itself might even have been generated. That would of course make it quite difficult to avoid that it gets included. But the above-mentioned update should help you, and it does eliminate the problem in the example you provided.
from reflectable.dart.
Related Issues (20)
- [question] - Is it possible to have Annotations with Parameters? HOT 2
- [Question] - how to get Constructor arguments? HOT 2
- [Bug?] ERROR: This requires the 'constructor-tearoffs' language feature to be enabled. HOT 12
- [Question] - Listening to Method invocation HOT 6
- [Question] - Stats on Bundle Sizes and Performance Implications/metrics of using Reflectable ? HOT 1
- Cannot reflect ```flutter/material.dart``` URIs for ```Container``` type HOT 12
- This reflector does not match anything HOT 11
- Reflectable is not a know builder HOT 1
- Unsupported operation: location HOT 4
- Reflectable don't find "main" but im using in my library not an application HOT 5
- How to generate code according to filter rules HOT 2
- The build_runner those not generate anything HOT 1
- Annotated parameter and Functions
- Include annotated types that are not imported to `main.dart` HOT 2
- Severe error during build with @reflector and @JsonKey on the same class. HOT 1
- isSubtype exception for classes without parents HOT 2
- Where is initializeReflectable method? HOT 3
- Error: Reflecting on un-marked type "Type" HOT 2
- bug: issue with using mixins HOT 5
- importing private libaries during build_runner build HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reflectable.dart.