superunitybuild / buildactions

BuildActions for use with the SuperUnityBuild build automation tool.
https://github.com/superunitybuild/buildtool
MIT License
184 stars 38 forks source link

CS0173 on FileUtility line 42 : "no implicit conversion between 'method group' and 'method group'" #35

Closed Arakade closed 8 months ago

Arakade commented 10 months ago

Full error message:

Library/PackageCache/com.github.superunitybuild.buildactions@4.0.1/Editor/FileUtility/FileUtility.cs(42,20): error CS0173: Type of conditional expressin cannot be determined because there is no implicit conversion between 'method group' and 'method group'

Linux + Unity 2020.3 (old LTS) -- it's an old project.

According to StackOverflow, it needs a cast on one of them to the return type.

Workaround

Copying the package from Library/PackageCache into Packages and applying that fix resolves the problem. Replace method body starting line 42 with:

            return isCopy ?
                (Action<string, string>) FileUtil.CopyFileOrDirectory :
                FileUtil.MoveFileOrDirectory;