Search Issue Tracker

Won't Fix

Votes

0

Found in

2022.3.57f1

Issue ID

UUM-96057

Regression

Yes

MonoScript.GetClass() returns type Enum when Script had Class Enum defined

-

How to reproduce:
1. Open “IN-93750_TestMonoScript“ project
2. Change the content of TestScript.cs to “enum Enum{}” and save
3. Right-click on the Script in the project window and select “Test MonoScript”
4. Observe Console

Expected result: MonoScript.GetClass() method returns null and an Error is displayed
Actual result: MonoScript.GetClass() returns type: Enum

Reproducible with: 2022.2.9f1, 2022.3.57f1
Not reproducible with: 2022.2.8f1, 6000.0.36f1, 6000.1.0b4, 6000.2.0a1
Could not test with: 2021.3.48f1 (GetClass() returns null for “class Enum{}”)

Reproducible on: macOS 15.2 (M1 Max)
Not reproducible on: no other environments tested

Note: this reproduces when the Script previously had any class or struct that passes the GetClass() method as not null.

  1. Resolution Note:

    Thank you for reporting a bug to Unity.

    We have reviewed the issue carefully, and in this case, the team is unable to prioritize fixing this bug. There are a number of reasons we make this decision, including the impact and severity of the issue across our user and customer base, and the possibility that future plans may solve the problem in a different way, or that a workaround for the bug may be available.

    Today we will be closing this case. Thank you again for taking the time to report this issue, and please let us know if there is anything else that changes the impact or severity of this issue.

    Please note the issue does not occur on Unity 6.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.