Comments (4)
Just considering a possible work-around: Is there an easy way to tell how many levels of lifting any particular piece of code will tolerate without getting a different semantics? (by 'lifting' I mean: moving a piece of code from inside to outside a given scope, similar to lambda lifting and similar to loop invariant expression hoisting). For code in a constructor or method argument list default expression, we'd just need to know that we can lift the expression one level (to global), and then we'd control the target context well enough (we're generating it) to make sure the expression doesn't get a different semantics when inserted there. This means that we would be able to use the naive approach for moving the code as long as it works, and then we could bail out with an error message in the cases where something more elaborate is needed (or we could run some other algorithms and cover more and more cases as we proceed, leaving fewer and fewer cases unimplemented).
from reflectable.dart.
Closing this issue: Implemented support for a number of special cases (including default value expressions which have no local dependencies such as literals, and expressions which are simple identifiers looked up in the same class or top-level of the same library); missing cases (e.g., using const somePrefix.C()
as a default value or using @somePrefix.C()
as metadata) will give rise to an error during transformation. We'll need extra tests for the missing cases as well, but this will enable a lot of simple usages of default values and annotations to work, and the remaining cases can be considered as bugs that we will fix along the way.
from reflectable.dart.
Reopening, as we do not support all constants yet.
from reflectable.dart.
I am convinced now that except for private constants (and that's a different issue) we can reconstruct all constants.
from reflectable.dart.
Related Issues (20)
- sdk minimal version should be 2.17.0 HOT 1
- Get annotation from enum field HOT 2
- 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
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.