Skip to content

Commit

Permalink
Monor
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayPianikov committed Apr 24, 2024
1 parent 861dc46 commit e80f947
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/Pure.DI.Core/Components/Api.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ public interface IOwned : global::System.IDisposable
[global::System.Diagnostics.DebuggerTypeProxy(typeof(global::Pure.DI.Owned.DebugView))]
internal partial class Owned : global::Pure.DI.IOwned
{
private global::System.Collections.Generic.List<IDisposable> _disposables = new global::System.Collections.Generic.List<IDisposable>();
private global::System.Collections.Generic.List<global::System.IDisposable> _disposables = new global::System.Collections.Generic.List<global::System.IDisposable>();

/// <summary>
/// Adds a disposable instance.
Expand Down Expand Up @@ -1175,9 +1175,9 @@ public DebugView(global::Pure.DI.Owned owned)
/// The value.
/// </summary>
public readonly T Value;
private readonly IOwned _owned;
private readonly global::Pure.DI.IOwned _owned;

public Owned(T value, IOwned owned)
public Owned(T value, global::Pure.DI.IOwned owned)
{
Value = value;
_owned = owned;
Expand Down
9 changes: 5 additions & 4 deletions src/Pure.DI.Core/Core/BindingBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,14 @@ public MdBinding Build(MdSetup setup)
}
}

var id = new Lazy<int>(idGenerator.Generate);
return new MdBinding(
0,
source,
setup,
semanticModel,
_contracts.Select(i => i with { Tags = i.Tags.Select(tag => BuildTag(tag, type)).ToImmutableArray()}).ToImmutableArray(),
_tags.Select(tag => BuildTag(tag, type)).ToImmutableArray(),
_contracts.Select(i => i with { Tags = i.Tags.Select(tag => BuildTag(tag, type, id)).ToImmutableArray()}).ToImmutableArray(),
_tags.Select(tag => BuildTag(tag, type, id)).ToImmutableArray(),
_lifetime ?? _defaultLifetime?.Lifetime,
_implementation,
_factory,
Expand All @@ -141,7 +142,7 @@ public MdBinding Build(MdSetup setup)
}
}

private MdTag BuildTag(MdTag tag, ITypeSymbol? type)
private static MdTag BuildTag(MdTag tag, ITypeSymbol? type, Lazy<int> id)
{
if (type is null || tag.Value is null)
{
Expand All @@ -157,7 +158,7 @@ private MdTag BuildTag(MdTag tag, ITypeSymbol? type)
return tag with { Value = type };

case Tag.Unique:
return tag with { Value = new UniqueTag(idGenerator.Generate()) };
return tag with { Value = new UniqueTag(id.Value) };
}
}

Expand Down

0 comments on commit e80f947

Please sign in to comment.