Search Issue Tracker

Won't Fix

Votes

0

Found in

2021.3.30f1

2022.2.0a2

Issue ID

UUM-53126

Regression

No

"Can't add script" is thrown when adding a script with the presence of an apostrophe in a class

-

How to reproduce:
1. Open the attached project "UnityBrokenIfAttempts.zip"
2. Add Assets/Scenes/TestBehaviour.cs to the "GameObject" in the Hierarchy window

Expected results: "TestBehaviour.cs" is added to the "GameObject"
Actual results: Can't add script window is shown

Reproducible with: 2021.3.30f1, 2022.2.0a2
Not reproducible with: 2022.2.0a3, 2022.3.10f1, 2023.1.15f1, 2023.2.0b11, 2023.3.0a7

Reproducible on: Windows 11 22H2
Not reproducible on: No other environment tested

  1. Resolution Note:

    From 2022.2 this issue is fixed, but its impossible to backport as it was a fundamental change. In 2022.2 we use Roslyn to extract the information we need.
    The Parser used before 2022.2 also evaluates all #if as true, so in this case it breaks as it does not compile.

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.