Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Reflection;

namespace VContainer.Internal
{
Expand Down Expand Up @@ -31,6 +30,12 @@ public void Inject(object instance, IObjectResolver resolver, IReadOnlyList<IInj

public object CreateInstance(IObjectResolver resolver, IReadOnlyList<IInjectParameter> parameters)
{
#if UNITY_2020_1_OR_NEWER
if (typeof(UnityEngine.Component).IsAssignableFrom(injectTypeInfo.Type))
{
throw new NotSupportedException($"UnityEngine.Component:{injectTypeInfo.Type.Name} cannot be `new`");
}
#endif
var parameterInfos = injectTypeInfo.InjectConstructor.ParameterInfos;
var parameterKeys = injectTypeInfo.InjectConstructor.ParameterKeys;
var parameterValues = CappedArrayPool<object>.Shared8Limit.Rent(parameterInfos.Length);
Expand Down
Loading