Steps to reproduce
> [Collections.Generic.List[int]]@(1)
or
> [Management.Automation.LanguagePrimitives]::ConvertTo(@(1), [Collections.Generic.List[int]])
Note that casting @(1,2) will succeed. Only the case @(1) fails. This is a regression because it functions correctly in v4.
Expected behavior
Casts to an instance of List<int> containing a single element: 1
Actual behavior
Exception calling "ConvertTo" with "2" argument(s): "Cannot convert the "System.Object[]" value of type "System.Object[]" to type "System.Int32"."
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 5.0.10586.494
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.10586.494
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1