Search Issue Tracker
Active
Under Consideration for 6000.0.X, 6000.2.X, 6000.3.X, 6000.4.X
Votes
0
Found in
6000.0.62f1
6000.2.11f1
6000.3.0b9
6000.4.0a4
Issue ID
UUM-125631
Regression
No
Error ‘cannot use casts on l-values’ when a variable is assigned inside a second-level nested if statement before being used in a conversion
How to reproduce:
1. Open the project “IN-123001_D3DTest”
2. Observe the Console
Expected result: No shader error appears in the Console
Actual result: Shader error “… cannot use casts on l-values at Assets/SampleShader.shader(98) (on d3d11)” in the Console
Reproducible with: 2023.1.0a1, 6000.0.62f1, 6000.2.11f1, 6000.3.0b9, 6000.4.0a4
Reproducible on: Windows 11
Not reproducible on: No other environments tested
Notes:
- If the error does not appear, reimport the SampleShader asset (in the Assets tab, right click the asset → Reimport)
- The shader experiencing the error does not work, appears pink
- The issue reproduces on both DX11 and DX12
- The error appears when nesting the variable in the second level of an if statement
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- URP Samples have an empty "VolumeProfiles" folder
- URP Samples have a broken "FirstPersonsPlayer" Prefab
- Remote Config file throws ArgumentNullReference exceptions in the Console and does not render in Inspector
- Multiple errors are thrown and file does not parse when saving after removing a duplicate UI Document instance from the hierarchy
- Custom Inspector throws a NullReferenceException error even when using #if UNITY_EDITOR preprocessor directive
Add comment