Repository: dotnet/maui
File: src/Controls/src/SourceGen/CompiledBindingMarkup.cs (C#)

Code before:
					// This allows scenarios like CommunityToolkit.Mvvm's [ObservableProperty] to work correctly.
					_context.ReportDiagnostic(Diagnostic.Create(Descriptors.BindingPropertyNotFound, GetLocation(_node), p, previousPartType.ToFQDisplayString()));
					return false;
				}

				// TODO: detect if the type is annotated or not
				var enabledNullable = true;
				// var enabledNullable = previousPartType.NullableAnnotation == NullableAnnotation.Annotated
				// 	|| previousPartType.GetAttributes().Any(a => a.AttributeClass?.ToFQDisplayString() == "global::System.Runtime.CompilerServices.NullableContextAttribute"
				// 		&& a.ConstructorArguments.Length == 1
				// 		&& a.ConstructorArguments[0].Value is int nullableContextValue
				// 		&& nullableContextValue > 0);
				var memberIsNullable = currentPropertyType.IsTypeNullable(enabledNullable);
				isNullable |= memberIsNullable;

				IPathPart memberAccess = new MemberAccess(p, currentPropertyType.IsValueType);
				if (previousPartIsNullable)
				{
					memberAccess = new ConditionalAccess(memberAccess);
				}

				bindingPathParts.Add(memberAccess);

				// Determine if the property is writable
				// ObservableProperty-generated properties are always writable (they have a public setter)
				bool isWritable = isObservableProperty 
					|| (property is not null
						&& property.SetMethod is not null
						&& property.SetMethod.IsPublic()
						&& !property.SetMethod.IsInitOnly
						&& !property.SetMethod.IsStatic);

				// TODO: do this only if it is the last part?
				setterOptions = new SetterOptions(
					IsWritable: isWritable,
					AcceptsNullValue: memberIsNullable);

				previousPartType = currentPropertyType;
				previousPartIsNullable = memberIsNullable;
			}

			if (indexArg != null)
			{
				index = indexArg;

				// For arrays, use the element type directly without trying to find an indexer
				if (previousPartType is IArrayTypeSymbol arrayType)
				{
					if (!int.TryParse(indexArg, out int indexArgInt))
					{
						_context.ReportDiagnostic(Diagnostic.Create(Descriptors.BindingIndexerTypeUnsupported, GetLocation(_node), previousPartType.ToFQDisplayString()));

Review comment (suggestion):
```suggestion
				bool isWritable = isAssumedWritable 
```

Code after:
					// This allows scenarios like CommunityToolkit.Mvvm's [ObservableProperty] to work correctly.
					_context.ReportDiagnostic(Diagnostic.Create(Descriptors.BindingPropertyNotFound, GetLocation(_node), p, previousPartType.ToFQDisplayString()));
					return false;
				}

				// TODO: detect if the type is annotated or not
				var enabledNullable = true;
				// var enabledNullable = previousPartType.NullableAnnotation == NullableAnnotation.Annotated
				// 	|| previousPartType.GetAttributes().Any(a => a.AttributeClass?.ToFQDisplayString() == "global::System.Runtime.CompilerServices.NullableContextAttribute"
				// 		&& a.ConstructorArguments.Length == 1
				// 		&& a.ConstructorArguments[0].Value is int nullableContextValue
				// 		&& nullableContextValue > 0);
				var memberIsNullable = currentPropertyType.IsTypeNullable(enabledNullable);
				isNullable |= memberIsNullable;

				IPathPart memberAccess = new MemberAccess(p, currentPropertyType.IsValueType);
				if (previousPartIsNullable)
				{
					memberAccess = new ConditionalAccess(memberAccess);
				}

				bindingPathParts.Add(memberAccess);

				// Determine if the property is writable
				// ObservableProperty-generated properties are always writable (they have a public setter)
				bool isWritable = isAssumedWritable 
					|| (property is not null
						&& property.SetMethod is not null
						&& property.SetMethod.IsPublic()
						&& !property.SetMethod.IsInitOnly
						&& !property.SetMethod.IsStatic);

				// TODO: do this only if it is the last part?
				setterOptions = new SetterOptions(
					IsWritable: isWritable,
					AcceptsNullValue: memberIsNullable);

				previousPartType = currentPropertyType;
				previousPartIsNullable = memberIsNullable;
			}

			if (indexArg != null)
			{
				index = indexArg;

				// For arrays, use the element type directly without trying to find an indexer
				if (previousPartType is IArrayTypeSymbol arrayType)
				{
					if (!int.TryParse(indexArg, out int indexArgInt))
					{
						_context.ReportDiagnostic(Diagnostic.Create(Descriptors.BindingIndexerTypeUnsupported, GetLocation(_node), previousPartType.ToFQDisplayString()));