-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support nullable as optional dependency
- Loading branch information
Showing
11 changed files
with
165 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/Jab.FunctionalTests.Common/Mocks/ServiceImplementationWithNullable.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace JabTests; | ||
|
||
#nullable enable | ||
|
||
internal class ServiceImplementationWithNullable : IService | ||
{ | ||
public IService1 Parameter1 { get; } | ||
public IService2? Parameter2 { get; } | ||
public IEnumerable<IService3>? Parameter3 { get; } | ||
|
||
public ServiceImplementationWithNullable( | ||
IService1 parameter1, | ||
IService2? parameter2, | ||
IEnumerable<IService3>? parameter3) | ||
{ | ||
Parameter1 = parameter1; | ||
Parameter2 = parameter2; | ||
Parameter3 = parameter3; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Jab.FunctionalTests.Common/Mocks/ServiceImplementationWithNullableOptional.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace JabTests; | ||
|
||
#nullable enable | ||
|
||
internal class ServiceImplementationWithNullableOptional : IService | ||
{ | ||
public IService1 Parameter1 { get; } | ||
public IService2? Parameter2 { get; } | ||
public IEnumerable<IService3>? Parameter3 { get; } | ||
|
||
public ServiceImplementationWithNullableOptional( | ||
IService1 parameter1, | ||
IService2? parameter2 = null, | ||
IEnumerable<IService3>? parameter3 = null) | ||
{ | ||
Parameter1 = parameter1; | ||
Parameter2 = parameter2; | ||
Parameter3 = parameter3; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace Jab; | ||
|
||
internal record DefaultValueCallSite: ServiceCallSite | ||
{ | ||
public DefaultValueCallSite(ITypeSymbol serviceType) : base(serviceType, serviceType, ServiceLifetime.Transient, 0, false) | ||
{ | ||
} | ||
|
||
public override string ServiceTypeString => ServiceType.ToDisplayString(NullableFlowState.MaybeNull); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters