ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Tupitsyn (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IGNITE-5358) .NET: Nullable enum field in binary object causes type cast exception
Date Wed, 31 May 2017 13:46:04 GMT

    [ https://issues.apache.org/jira/browse/IGNITE-5358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16031173#comment-16031173
] 

Pavel Tupitsyn commented on IGNITE-5358:
----------------------------------------

Seems like switching to binary more in {{ReadBinaryObject}} is not necessary. Removing this
code fixes the issue and does not break anything.

> .NET: Nullable enum field in binary object causes type cast exception
> ---------------------------------------------------------------------
>
>                 Key: IGNITE-5358
>                 URL: https://issues.apache.org/jira/browse/IGNITE-5358
>             Project: Ignite
>          Issue Type: Bug
>          Components: platforms
>    Affects Versions: 2.0
>            Reporter: Pavel Tupitsyn
>            Assignee: Pavel Tupitsyn
>            Priority: Critical
>              Labels: .NET
>             Fix For: 2.1
>
>
> Reproducer:
> {code}
> enum TestEnum
> {
> 	TestValue1,
> 	TestValue2
> };
> class TestClass
> {
> 	public string Name { get; }
> 	public TestEnum? EnumValue { get; }
> 	public TestClass(string name, TestEnum? enumValue)
> 	{
> 		Name = name;
> 		EnumValue = enumValue;
> 	}
> }
> ...
> cache.Put("TestElem1", new TestClass("TestElem1", TestEnum.TestValue1));
> cache.Get("TestElem1");  // exception
> {code}
> Exception:
> {code}
> No coercion operator is defined between types 'Apache.Ignite.Core.Impl.Binary.BinaryEnum'
and 'System.Nullable`1[UserQuery+TestEnum]'. 
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message