question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proposal: Relax new() constraint on TResponse

See original GitHub issue

Is the new() constraint really needed? Wouldn’t NoContent if response is null suffice?

It feels weird having to implement a public (of all things) default constructor seemingly only because one line of code needs new() as guard against null.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
KennethHoffcommented, Aug 11, 2022

I think throwing an NRE there is probably a good thing. It makes no sense to return null and then calling that ok. What does null in this context refer to?

0reactions
dj-nitehawkcommented, Aug 12, 2022

since TResponse has a notnull constraint, the ide should display a warning anyway.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RFC 7807 - Problem Details for HTTP APIs
This specification does this by identifying a specific type of problem (e.g., "out of credit") with a URI [RFC3986]; HTTP APIs can do...
Read more >
[Proposal] Add generic constraint 'notabstract' #7311
All that this constraint should do is disallow a developer to pass the abstract class as T . Of course, we have the...
Read more >
W3C XML Schema Definition Language (XSD) 1.1 Part 1
For a given information item I , an expression of the form " I . [new property]" denotes the (value of the) property...
Read more >
Core Features
This section dives into the details of Spring Boot. Here you can learn about the key features that you may want to use...
Read more >
3 SOLVING PROBLEMS BY SEARCHING
Once the solution has been executed, the agent will formulate a new goal. Notice that while the agent is executing the solution sequence...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found