GithubHelp home page GithubHelp logo

Remove unnecessary interfaces about kotest HOT 6 CLOSED

kotest avatar kotest commented on May 22, 2024
Remove unnecessary interfaces

from kotest.

Comments (6)

sksamuel avatar sksamuel commented on May 22, 2024

Would it be a breaking change? Is that becausr they'd need to add an
import?
On 16 Jun 2016 21:40, "Christian Helmbold" [email protected] wrote:

Some interfaces exist only to hold concrete methods. In languages like
Java and Scala this is necessary, but Kotlin supports top level functions
https://kotlinlang.org/docs/reference/functions.html#function-scope, so
this code can be slightly reduced by removing the interfaces.

The following interfaces could be removed: Inspectors, Eventually,
CollectionMatchers, ExceptionMatchers, IntMatchers, LongMatchers,
MapMatchers, StringMatchers, TypeMatchers. This would be a breaking change.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#33, or mute the thread
https://github.com/notifications/unsubscribe/AAtZGiVW9u2m1kNVKtd52lLgzfKzQ7cGks5qMbSngaJpZM4I3ybP
.

from kotest.

helmbold avatar helmbold commented on May 22, 2024

Yes, the code on the user site would have to be changed due to the required imports.

from kotest.

sksamuel avatar sksamuel commented on May 22, 2024

Is there anyway you can inherit imports in Kotlin?
On 16 Jun 2016 21:46, "Christian Helmbold" [email protected] wrote:

Yes, the code on the user site would have to be changed due to the
required imports.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#33 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAtZGnQPYmbDoTZS5QBpxMSqDSOYVFTKks5qMbYogaJpZM4I3ybP
.

from kotest.

helmbold avatar helmbold commented on May 22, 2024

At least I'm not aware of such a possibility. But you could place the functions to be inherited in interfaces and add them to the test base class :-D

My idea was to keep the code as clean and idiomatic as possible, but maybe using interfaces here is more convenient for the users.

from kotest.

sksamuel avatar sksamuel commented on May 22, 2024

I only did it as interfaces because I like them to be in scope automatically, and because its quite "scalay". I've been a Scala developer for 5 years at work, and I haven't touched Java since, so a lot of my opinions are influenced by that.

from kotest.

helmbold avatar helmbold commented on May 22, 2024

When I was writing this issue, I haven't thought of the convenience aspect. I think it is ok, to just close this ticket.

from kotest.

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.