Comments (6)
Concrete
has to be in the same "library" as Abstract
.
Either put them in the same file, or have both share a part
/part of
relationship
from language.
I find it very unappealing that it is possible to call a method that is not implemented in a static language without a compile time error
That was my motivation for creating this issue: dart-lang/linter#2938. You can check out the reasons given there for preferring that programs break at run time. I'd still prefer to have at least a notification at compile time.
from language.
I know since I am declaring two libraries (each file is a library) I can't access private properties/methods. I was asking this question because declaring both as the same library don't seem to model well for a feature based project.
Look at this example:
abstract.dart
feature1/
concrete1.dart
feature2/
concrete2.dart
Why would concrete1 and concrete2 be part of the same library? I would prefer a feature
to be a library instead.
from language.
I don't know if I understood well what you mean. Doesn't @protected
works for you?
from language.
@mateusfccp AFAIK, @protected
is just an annotation and don't solve my problem if both classes are declared on different files/libraries.
I have another issue with this example that the Dart team may explain. I find it very unappealing that it is possible to call a method that is not implemented in a static language without a compile time error (I understand why it happens, I just don't think that's good design). Given a class (e.g. Abstract
) with a private abstract method (e.g. _aInt
) shouldn't be a compile error to extend it from a different library? If is in the same library it should be mandatory to override it (which already happens).
from language.
@mateusfccp AFAIK,
@protected
is just an annotation and don't solve my problem if both classes are declared on different files/libraries.
You have to use it in a public method/getter. Then you will be warned if you use it in an inappropriate place.
from language.
Related Issues (20)
- Extensions on nested generic mixins don't promote types properly HOT 6
- Disallow extension typed declarations with bottom as representation type - from implementing interface types. HOT 7
- Detect the following situation during compile time - not during runtime HOT 2
- [extension types] platform independence HOT 9
- static abstract members in interfaces HOT 2
- Map Patterns Deconstructing a Non-Existent Key Throws an Exception HOT 2
- Github action gets "This requires the 'macros' feature..." HOT 2
- Add `..` to continuation tokens for constructor-tearoff type argument selector.
- Allow extension type to implement its representation type. HOT 4
- const-by-default constructors HOT 5
- const_constructor_param_type_mismatch generates poor errors: HOT 2
- Change `augment super` to `augmented` (or similar) HOT 5
- literal-conforming assignment operator HOT 3
- Stop allowing void-to-void data transfer? HOT 10
- Clarify the kinds of instance members in specification documents HOT 1
- Make `augment` contextual in regular libraries and reserved in augmentation libraries HOT 3
- Make extension type non-nullability not be implicit. HOT 7
- Pattern matching an element in the middle of a list. HOT 5
- Change how `augmented` works for operators HOT 11
- Inconsistent behavior of field promotion in irrefutable patterns. 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 language.