InputSystem 1.11.0 - cannot convert from 'int' to 'System.Collections.Generic.IEnumerable<int>

Unity 2020.3.25. Updated through package manager to Input System 1.11.0 and now get the following error on 2 scripts InputDeviceBuilder.cs(79,56) and InputControlExtensions.cs(1933,60).

What’s strange is the compiler directive doesn’t seem to work, as I’m getting pre-2020 version.

#if UNITY_2020_1_OR_NEWER
device.m_UpdatedButtons = new HashSet<int>(i);
#else
// 2019 is too old to support setting HashSet capacity
device.m_UpdatedButtons = new HashSet<int>();
 #endif

image

The 2020+ version is greyed out… This (older) code seems to compile ok up to UIS 1.8.2. After that, it throws compile errors.

Your IDE is probably just not picking up symbols correctly and misreporting that the symbol is not defined. The error will not occur with the older code path that uses the parameterless constructor. The issue is that .NET Framework 4.7.1 (for Unity 2020.3) does not define a hash set constructor that takes an initial capacity, this came in .NET Framework 4.7.2 and .NET Standard 2.1. You will need to embed the package and change the call to use the parameterless constructor. It would also be prudent to file a bug report.

1 Like