ssannandeji / Zenject-2019

Dependency Injection Framework for Unity3D
MIT License
2.53k stars 363 forks source link

Zenject 6.6.0 UWP compilation error #621

Open reflexing opened 5 years ago

reflexing commented 5 years ago

Got compilation errors with Zenject 6.6.0 under Unity 2017.4.24f1 UWP build under .NET 4.6:

Assets\Plugins\Zenject\Source\Util\ReflectionInfoTypeInfoConverter.cs(105,22): error CS0428: Cannot convert method group 'ContainsGenericParameters' to non-delegate type 'bool'. Did you intend to invoke the method?

(Filename: Assets\Plugins\Zenject\Source\Util\ReflectionInfoTypeInfoConverter.cs Line: 105)
Assets\Plugins\Zenject\Source\Util\ReflectionInfoTypeInfoConverter.cs(141,42): error CS0428: Cannot convert method group 'ContainsGenericParameters' to non-delegate type 'bool'. Did you intend to invoke the method?

(Filename: Assets\Plugins\Zenject\Source\Util\ReflectionInfoTypeInfoConverter.cs Line: 141)
Assets\Plugins\Zenject\Source\Util\ReflectionInfoTypeInfoConverter.cs(148,46): error CS0428: Cannot convert method group 'ContainsGenericParameters' to non-delegate type 'bool'. Did you intend to invoke the method?

(Filename: Assets\Plugins\Zenject\Source\Util\ReflectionInfoTypeInfoConverter.cs Line: 148)
Assets\Plugins\Zenject\Source\Util\ReflectionInfoTypeInfoConverter.cs(148,30): error CS1662: Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type

(Filename: Assets\Plugins\Zenject\Source\Util\ReflectionInfoTypeInfoConverter.cs Line: 148)
Assets\Plugins\Zenject\Source\Util\ReflectionInfoTypeInfoConverter.cs(242,28): error CS0428: Cannot convert method group 'ContainsGenericParameters' to non-delegate type 'bool'. Did you intend to invoke the method?

(Filename: Assets\Plugins\Zenject\Source\Util\ReflectionInfoTypeInfoConverter.cs Line: 242)

solved them by uncommenting

define ZEN_DO_NOT_USE_COMPILED_EXPRESSIONS

I think these are reflection baking related and it doesn't work on WSA? Got in the logs:

Zenject reflection baking skipped because it is not currently supported on WSA platform!

svermeulen commented 5 years ago

Thanks for reporting this. I've fixed this in https://github.com/svermeulen/Extenject with 1b319c762ec77a4b75e38151fe224d1005d1e261 and will add it to 6.6.1