Skip to content

was never called overload has limitations #54

Closed

Description

@jozic

Writing something like

      aMock.doSomethingWithThisIntAndString(*, "test") was never called
      aMock.doSomethingWithThisIntAndString(*, "test") was never called

doesn't compile

while

      aMock.doSomethingWithThisIntAndString(*, "test") was never called
   // line break is required to compile
      aMock.doSomethingWithThisIntAndString(*, "test") was never called

compiles fine

image

Activity

  1. jozic commented on Nov 6, 2018

    @jozic
    ContributorAuthor
  2. ultrasecreth commented on Nov 7, 2018

    @ultrasecreth
    Member

    @jozic Yeah, I've seen this before somewhere else, I'm not exactly sure if it can be solved while keeping the same syntax (I wouldn't like to introduce antother breaking change)
    Ideas?

  3. jozic commented on Nov 7, 2018

    @jozic
    ContributorAuthor

    I understand that breaking changes are bad, but non compiling code is even worse :)
    and it wasn't like I figured out the solution in 5 seconds, I was almost at the point to give up

    so i personally think it should be fixed at any cost, but of course this is just my opinion

  4. ultrasecreth commented on Nov 7, 2018

    @ultrasecreth
    Member

    The problem is that the postfix notation can not always infer where the ; goes, that's one of the reasons why it's hidden behind a feature flag

    my point is I'm not sure how to re-write the 3 use cases in case that's the only solution, i.e.

    mock1.bar was called
    mock1.bar was never called
    aMock was never called again
    

    How can we semantically re-write those 3 while keeping an english syntax that makes sense

  5. jozic commented on Nov 8, 2018

    @jozic
    ContributorAuthor

    was never calledAgain? was neverCalled again?
    it looks worse then all words separately, but we already sort of have similar case with was called and wasCalled once

  6. ultrasecreth commented on Nov 8, 2018

    @ultrasecreth
    Member

    @jozic not sure if you get the notifications for the PR #56, so just in case I drop this "please check it out here" :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions