Skip to content

Wrong use of Generic type #17

@mariomastrodicasa

Description

@mariomastrodicasa

In the following line

async Task InternalSendMessage<T>(T message, string key = null)
you use a generic type, but in the function boby there are many specific cast on string like in
byte[] msg = ASCIIEncoding.ASCII.GetBytes(message as string);

Or the generic type must have constraints on string, or T shall reference a specific interface which is able to convert any T into a string, or T shall be substituted with string.

Other project use the function always with a string type and indeed it works for now.

Metadata

Metadata

Labels

bugSomething isn't workingquestionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions