unoplatform / Uno.CodeGen

A set of source generators for equality, immutability, ...

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[EqualityHash] on objects try to convert them to string in instead of getting hash

DevenColletteNV opened this issue · comments

error CS1503: Argument 1: cannot convert from 'MyProject.AuthenticationData' to 'string'

[Bindable]
[GeneratedImmutable]
public partial class ApplicationSettings
{
[EqualityHash]
public AuthenticationData AuthenticationData { get; }
...}

[Bindable]
[GeneratedImmutable]
public partial class AuthenticationData
{
public AuthenticationData(string accessToken)
{
AccessToken = accessToken;
}

[SerializationProperty("access_token")]
[EqualityKey]
public string AccessToken { get; }
}

}

The bug was caused by a wrong condition. It should have tested for "string" but it was "reference type" instead. The PR should fix this.