Input version 1.11.2 causes instant compile error

I was having a bug with the event system, and while looking for a solution I found that I am using an outdated version of the input system. I was on 1.0.2, so I tried to update to the latest version, all the way up to 1.11.2, but as soon as I did I got this error:

Library\PackageCache\com.unity.inputsystem@1.11.2\InputSystem\Devices\InputDeviceBuilder.cs(79,56): error CS1503: Argument 1: cannot convert from ‘int’ to ‘System.Collections.Generic.IEnumerable’

I tried going down one level to 1.11.1 and got the same thing.
I can’t even run my game anymore, and I don’t know how I’m supposed to fix a compile error in an official Unity package, let alone how a compile error could be included in an official Unity package.

Any help?

So this is the code in question in InputDeviceBuilder:

public InputDevice Finish()
{
    var device = m_Device;

    // Set up the list of just ButtonControls to quickly update press state.
    var i = 0;
    foreach (var control in device.allControls)
    {
        if (control.isButton)
            ++i;
    }

    device.m_ButtonControlsCheckingPressState = new List<ButtonControl>(i);
    #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

    // Kill off our state.
    Reset();

    return device;
}

Namely the error is occuring at device.m_UpdatedButtons = new HashSet<int>(i);, which appears to be because whoever wrote this code got their versions wrong as Unity 2020.1 (and by extension, 2020.3) - which is using .Net Framework 4.6 - does not have this constructor for hash set available: HashSet<T> Constructor (System.Collections.Generic) | Microsoft Learn

Pretty piss poor mistake on their part to be honest.

I would use your version control to roll this back for now. Maybe try a less new one like 1.8.2, where this error doesn’t appear to be present.

I guess that’s why it’s version 1.0.2 is labeled as “verified” unlike the higher versions.

Well fudge, I needed the later version to (hopefully) get around a bug in the input system. I was planning on changing to a newer version of Unity anyway (the editor keeps crashing on me and Unity won’t support this version) but I know that can cause a lot of unexpected problems so I want to get this demo finished/released first.

In the meantime I’ve got a half-workaround that results in a bug where if you open the graphics settings menu, you won’t be able to open it again until you completely exit the settings menu. Guhhhhh…

I mean based on the input system docs, every version, even the most recent one, is meant to be compatible with any Unity versions from 2019.4+. Just in this case someone made an error.

Like I said, I would try another version such as 1.8.2 where this particular code isn’t present.

I just tried 1.8.2, and it compiles, but it didn’t fix the error I was originally encountering. Looking at the comments on the thread I was reading, I’m guessing I need version 1.11.x before this bug is fixed, if it even is.

Thanks though; at least I know what’s going on with that newer version.

Eff it, I’m just going to add a counter to my script that requires the “go back” button to be hit twice before it does anything.
A little bit of duct tape, and if women don’t find me handsome, they’ll at least find me handy.