Skip to content

Commit 17871c2

Browse files
committed
Fix string type check for property initialization
Updated the property type check to use EndsWith("##string") and EndsWith("##string?") instead of direct equality. This ensures correct initialization for string properties with type suffixes.
1 parent 1e2df35 commit 17871c2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/ReactiveUI.SourceGenerators.Roslyn/ObservableAsProperty/ObservableAsPropertyGenerator{FromObservable}.Execute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ private static string GetPropertySyntax(ObservableMethodInfo propertyInfo)
309309
var isPartialProperty = string.Empty;
310310
var propertyType = propertyInfo.ObservableType;
311311
string? initVal;
312-
if (propertyType.Equals("string") || propertyType.Equals("string?"))
312+
if (propertyType.EndsWith("##string") || propertyType.EndsWith("##string?"))
313313
{
314314
initVal = $""" = "{propertyInfo.InitialValue}";""";
315315
}

0 commit comments

Comments
 (0)