JetBrains / JetBrains/resharper-unity

That new "Implicit check for Unity object lifetime" is nonsense

Open
#2,461 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
C#
Stars
1.2k
Forks
142
PR merge metrics
No merged PRs in 30d

Description

Just noticed that new suggestion after upgrading today.

See by yourself, code was fine but applying either fix makes it worse actually:

New icon:

![image](https://github.com/user-attachments/assets/d6515f92-c6ec-4fee-ac27-a0584baf3c2d)

Fixes:

![image](https://github.com/user-attachments/assets/3dd18f04-d371-4e35-9a40-eab5a8905e3b)

After fix 1:

![image](https://github.com/user-attachments/assets/1766f050-e41f-48f0-ae95-e1aa3dcc30d4)

After fix 2:

![image](https://github.com/user-attachments/assets/49ce8efb-34af-4832-9b45-65d0da54c9a5)

```
JetBrains ReSharper 2024.2.4
Build 242.0.20240905.115624 built on 2024-09-05
dotTrace 2024.2.20240905.115624
ReSharper C++ 2024.2.20240905.115624
ReSharper 2024.2.20240905.115624
JetBrains ForTea 2024.2.1.3 (Compatible)
JetBrains Unity 2024.2.3.166 (Compatible)

ReSharper 2024.2.4 licensed to aybe aybe. Subscription is valid through 1/16/2025. Perpetual for builds released before 1/17/2024.
ReSharper C++ 2024.2.4 licensed to aybe aybe. Subscription is valid through 1/16/2025. Perpetual for builds released before 1/17/2024.
TeamCity Add-in 2024.2.4 disabled by user preferences.

Build Version: 2024.2.4.65536

Visual Studio Enterprise 2022
Version 17.11.2, InstanceId a77197d5.
InstallVersion: 17.11.35222.181
InstallDir: “C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE”
LocalAppData: C:\Users\aybe\AppData\Local\Microsoft\VisualStudio\17.0_a77197d5

Branch: refs/heads/242.21829

Application Packages:
...
JetBrains Unity build 2024.2.3.166 on 0001-01-01

```

Contributor guide

Open the contributing guide

Research direction

The issue names no source file, test, or entry point. Reproduce the “Implicit check for Unity object lifetime” suggestion using the reported ReSharper Unity and Visual Studio versions, then inspect the suggested fixes shown in the screenshots. Done means the inspection no longer appears for valid code or offers fixes that make the code worse.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, unity
Domain
devtools, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.