JetBrains / JetBrains/resharper-unity

Mark transform as not-nullable

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

Description

The ReadMe states

> Mark `Component.gameObject` and `Object.name` as not-nullable

But `transform` is not explicitly marked as not-null as well despite Unity official documentation stating

> Every GameObject has a Transform

**Source:** https://docs.unity3d.com/Manual/class-Transform.html

Is there a specific reason it isn't covered as well? Could this be fixed / added?\

**EDIT:** Both `Component.transform` and `GameObject.transform` are affected.
First one is accessed when just typing `transform` and second one when typing `gameObject.transform` explicitly.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.