Skip to content

Comments

tests surrogates for generic arguments:#75

Open
rotanov wants to merge 1 commit intoklenin:masterfrom
rotanov:surrogates_tests
Open

tests surrogates for generic arguments:#75
rotanov wants to merge 1 commit intoklenin:masterfrom
rotanov:surrogates_tests

Conversation

@rotanov
Copy link
Collaborator

@rotanov rotanov commented Aug 1, 2019

Samples based on:

var bs = new BinarySerializer();
var b1 = bs.ToBytes(new SurrogateDictionaryKey { F = { { 1, 2 }, { 3, 4 }, { 5, 6 } } });
var b2 = bs.ToBytes(new SurrogateDictionaryValue { F = { { 7, 8 }, { 9, 10 }, { 11, 12 } } });
var b3 = bs.ToBytes(new SurrogateListElement { F = { 1, 2, 3, 4 } });
var b4 = bs.ToBytes(new SurrogateHashSetElement { F = { 6, 7, 8, 9 } });
var b5 = bs.ToBytes(new SurrogateCustomGenericArgument { F = new SurrogateCustomGenericArgument.Generic<string> { F = "47" } });
var b6 = bs.ToBytes(new SurrogateCustomGeneric { F = "31" });

Deserializating b5 yields `Yuzu.YuzuException:

Unable to assign type "YuzuTest.SurrogateCustomGenericArgument+Generic`1[System.String]" to "YuzuTest.SurrogateCustomGenericArgument+Generic`1[[YuzuTest.SurrogateIntToStringSample, YuzuTest]], YuzuTest"'

- Dictionary<T, V>, T <=> int
- Dictionary<V, T>, T <=> int
- List<T>, T <=> int
- HashSet<T>, T <=> int
- CustomGeneric<T>, T <=> string
- CustomGeneric<T>, CustomGeneric<T> <=> string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant