Skip to content

Commit 3e95981

Browse files
committed
Fix generation issues
1 parent ce8fc2e commit 3e95981

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

ManualDi.Main/ManualDi.Main.Tests/TestsSourceGenerator.Generated.verified.txt

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ namespace ManualDi.Main
272272
[MethodImpl(MethodImplOptions.AggressiveInlining)]
273273
internal static TypeBinding<T, ConstructorWithGenericArgument> FromConstructor<T>(this TypeBinding<T, ConstructorWithGenericArgument> typeBinding)
274274
{
275-
return typeBinding.FromMethod(static c => new ConstructorWithGenericArgument(c.Resolve<Func<int>>()));
275+
return typeBinding.FromMethod(static c => new ConstructorWithGenericArgument(c.Resolve<System.Func<int>>()));
276276
}
277277

278278
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -387,18 +387,21 @@ namespace ManualDi.Main
387387
public static partial class ManualDiGeneratedExtensions
388388
{
389389
[MethodImpl(MethodImplOptions.AggressiveInlining)]
390+
[System.Obsolete]
390391
internal static TypeBinding<T, Obsolete> FromConstructor<T>(this TypeBinding<T, Obsolete> typeBinding)
391392
{
392393
return typeBinding.FromMethod(static c => new Obsolete());
393394
}
394395

395396
[MethodImpl(MethodImplOptions.AggressiveInlining)]
397+
[System.Obsolete]
396398
internal static TypeBinding<T, Obsolete> Initialize<T>(this TypeBinding<T, Obsolete> typeBinding)
397399
{
398400
return typeBinding.Initialize(static (o, c) => o.Initialize());
399401
}
400402

401403
[MethodImpl(MethodImplOptions.AggressiveInlining)]
404+
[System.Obsolete]
402405
internal static TypeBinding<T, Obsolete> Inject<T>(this TypeBinding<T, Obsolete> typeBinding)
403406
{
404407
return typeBinding.Inject(static (o, c) =>
@@ -408,6 +411,7 @@ namespace ManualDi.Main
408411
}
409412

410413
[MethodImpl(MethodImplOptions.AggressiveInlining)]
414+
[System.Obsolete]
411415
internal static TypeBinding<T, Obsolete> Default<T>(this TypeBinding<T, Obsolete> typeBinding)
412416
{
413417
return typeBinding.Initialize().Inject();
@@ -426,7 +430,7 @@ namespace ManualDi.Main
426430
public static TypeBinding<T, NullableDependency> FromConstructor<T>(this TypeBinding<T, NullableDependency> typeBinding)
427431
{
428432
return typeBinding.FromMethod(static c => new NullableDependency(c.ResolveNullable<object>(),
429-
c.Resolve<Nullable<int>>()));
433+
c.ResolveNullableValue<int>()));
430434
}
431435

432436
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -443,7 +447,7 @@ namespace ManualDi.Main
443447
{
444448
o.Object = c.ResolveNullable<object>();
445449
o.Int = c.ResolveNullableValue<int>();
446-
o.Int3 = c.Resolve<Nullable<int>>();
450+
o.Int3 = c.ResolveNullableValue<int>();
447451
o.Inject(c.ResolveNullable<object>(),
448452
c.ResolveNullableValue<int>());
449453
});
@@ -561,14 +565,14 @@ namespace ManualDi.Main
561565
{
562566
return typeBinding.Inject(static (o, c) =>
563567
{
564-
o.Object = c.Resolve<Lazy<object>>();
565-
o.NullableObject = c.Resolve<Lazy<object?>>();
566-
o.Value = c.Resolve<Lazy<int>>();
567-
o.NullableValue = c.Resolve<Lazy<int?>>();
568-
o.Inject(c.Resolve<Lazy<object>>(),
569-
c.Resolve<Lazy<object?>>(),
570-
c.Resolve<Lazy<int>>(),
571-
c.Resolve<Lazy<int?>>());
568+
o.Object = new System.Lazy<object>(() => c.Resolve<object>());
569+
o.NullableObject = new System.Lazy<object?>(() => c.ResolveNullable<object>());
570+
o.Value = new System.Lazy<int>(() => c.Resolve<int>());
571+
o.NullableValue = new System.Lazy<int?>(() => c.ResolveNullableValue<int>());
572+
o.Inject(new System.Lazy<object>(() => c.Resolve<object>()),
573+
new System.Lazy<object?>(() => c.ResolveNullable<object>()),
574+
new System.Lazy<int>(() => c.Resolve<int>()),
575+
new System.Lazy<int?>(() => c.ResolveNullableValue<int>()));
572576
});
573577
}
574578

0 commit comments

Comments
 (0)