Comments (2)
There are multiple valid ways to express the idea of a dependency being optional when designing a class in C#:
class Foo { public Foo(Bar? bar); }
class Foo { public Foo(Bar? bar = null); }
But only one aligns with how Jab resolution rules are set up. The diagnostic highlights that there might be a misalignment between customer expectations and Jab logic.
Think about it similar to compiler highlighting if (a == null)
check when a
is annotated as non-nullable. The code is fine, but the branch will never fire.
from jab.
Thanks for the explanation
from jab.
Related Issues (20)
- Register both as service and implementation HOT 1
- Unity support (Microsoft.CodeAnalysis 3.8) HOT 3
- Can I get additional services inside of a ServiceProviderModule factory method? HOT 2
- Constructor from other part of a partial class is not detected and produces invalid code. HOT 2
- System.UriFormatException from Request textDocument/references for source generator in vscode with C# extrnsion
- Is this project abandoned? HOT 4
- Support nullable as optional dependency HOT 1
- Kindly remove .NET 3.x HOT 1
- Removing unnecessary code from output assembly HOT 11
- Creating lazy type-safe factories for safe runtime service provision HOT 2
- Provide a changelog HOT 1
- Register service type + implementation type in Jab modules HOT 5
- Abstract class with ServiceProvider shouldn't be generated, but his children should HOT 4
- Make IServiceProvider<T> public?
- Performance Improvements Suggestion: Avoid `locks` for Singletons and for RootScope HOT 4
- Performance Improvements Suggestion: Removing the `TryAddDisposable()`
- Performance Improvements Suggestion: Avoid runtime checks for `this.GetService<T>()`
- Named services cyclic dependency
- Reference issue using generated interface HOT 1
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 jab.