Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong use of Generic type #17

Open
mariomastrodicasa opened this issue Jun 30, 2021 · 0 comments
Open

Wrong use of Generic type #17

mariomastrodicasa opened this issue Jun 30, 2021 · 0 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@mariomastrodicasa
Copy link
Contributor

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.

@mariomastrodicasa mariomastrodicasa added bug Something isn't working question Further information is requested labels Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants