Coder Social home page Coder Social logo

Comments (6)

rrousselGit avatar rrousselGit commented on June 26, 2024 1

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.

eernstg avatar eernstg commented on June 26, 2024 1

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.

rubenferreira97 avatar rubenferreira97 commented on June 26, 2024

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.

mateusfccp avatar mateusfccp commented on June 26, 2024

I don't know if I understood well what you mean. Doesn't @protected works for you?

from language.

rubenferreira97 avatar rubenferreira97 commented on June 26, 2024

@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 avatar mateusfccp commented on June 26, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.