Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

Getting error CS0702: Constraint cannot be special class 'Enum'

Discussion in 'Project Tiny' started by rakibs, Dec 8, 2018.

  1. rakibs

    rakibs

    Joined:
    Mar 6, 2015
    Posts:
    3
    Hello I am getting 3 error while using the Tiny Mode on Unity 18.3.0f1. I followed this process https://docs.unity3d.com/Packages/com.unity.tiny@0.13/manual/installing-tiny.html

    Code (CSharp):
    1. Library\PackageCache\com.unity.tiny@0.13.2-preview\Runtime\Runtime\Utility\EnumExtensions.cs(41,22): error CS1929: 'TEnum' does not contain a definition for 'HasFlag' and the best extension method overload 'EnumExtensions.HasFlag(Enum, Enum)' requires a receiver of type 'Enum'
    2.  
    3. Library\PackageCache\com.unity.tiny@0.13.2-preview\Runtime\Runtime\Utility\EnumExtensions.cs(66,27): error CS0702: Constraint cannot be special class 'Enum'
    4.  
    5. Library\PackageCache\com.unity.tiny@0.13.2-preview\Runtime\Runtime\Utility\EnumExtensions.cs(35,27): error CS0702: Constraint cannot be special class 'Enum'
     
  2. etienne_unity

    etienne_unity

    Unity Technologies

    Joined:
    Aug 31, 2017
    Posts:
    102
    Hi @rakibs

    You should be able to install Tiny Mode using 2018.3.0f1 within a new project: the default project settings are compatible with Tiny.

    The errors you're seeing are related to the current Scripting Runtime Version (.Net 4.x Equivalent is required) and Api compatibility level (either .NET 4.x or .NET Standard 2.0 are supported).
     
  3. rakibs

    rakibs

    Joined:
    Mar 6, 2015
    Posts:
    3
    Thanks. I had to create another project and this time there was no error