Comments (5)
Thanks for spotting this! It is a bug when you get the 'Unexpected situation' exception (a fix will be included in the next commit), but it will not help you much: admitSubtypeCapability
has not yet been implemented, and you would just get an UnimplementedError
exception instead.
There is a rather detailed discussion about this capability in the design document https://github.com/dart-lang/reflectable/blob/master/reflectable/doc/TheDesignOfReflectableCapabilities.md which illustrates why the whole concept is questionable (and hence it might be dropped). However, if it would be very helpful for you then please make the case for it, and then we can keep your arguments in mind because they are on the issue list.
PS: That would then be a new issue, because this one gets closed when the bug fix is available.
from reflectable.dart.
I think @lassedamgaard mentions superclassQuantifyCapability, not admitSubtypeCapability.
@lassedamgaard: Are you sure this is the only capability spec in your program? - the error message suggest you are using admitSubtypeCapability, and that is still unimplemented.
from reflectable.dart.
Sorry guys, wrong copy-pasta, the capability spec was supposed to say admitSubtypeCapability
. I've corrected it.
Anyway, I don't have a need for this capability at the moment, just spotted this trying some things out and thought it should have a better error message. In general if there are going to be capabilities that aren't supported by the transformer I think they should be checked early and generate a descriptive error message instead of throwing.
from reflectable.dart.
The error message for admitSubtypeCapability
was plain wrong (a certain test for whether we encountered such a capability was wrong, so we missed that case and continued to the final catch-all case that we should never reach -- hence the "Unexpected situation"). It is fixed in the next upcoming commit.
With respect to the diagnostic message: There is already issue #39 requesting a similar thing, namely that errors should be reported but then caught, such that the transformer can continue transforming the remaining entry points rather than stopping entirely.
from reflectable.dart.
Addressed by commit 5a835be on https://github.com/dart-lang/reflectable/commits/master.
from reflectable.dart.
Related Issues (20)
- Fails when upgrading
- 【macos】Attempt to `invoke` without class mirrors. HOT 1
- [Question] is it possible build an "Angular Style DI" library using Reflectable? HOT 1
- [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
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.