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

Added custom error message when trying to assign constraint type to generic type parameter #30394

Conversation

JoshuaKGoldberg
Copy link
Contributor

Fixes #29049.

This also adds the new message in chained error messages. typeParameterDiamond4.errors.txt shows it appearing twice in the "diamond" scenario. I can't tell if this severely increased amount of nested messages is good or bad...?

I also wonder if the message should have "Although " prepended to the front to make it more clear that this is a useful suggestion?

…eneric type parameter

Fixes microsoft#29049.

This also adds the new message in chained error messages. `typeParameterDiamond4.errors.txt` shows it appearing twice in the "diamond" scenario. I can't tell if this severely increased amount of nested messages is good or bad...?
@JoshuaKGoldberg
Copy link
Contributor Author

Ping @RyanCavanaugh, could this be reviewed please?

I can keep merging in master once it's verified this is the right approach.

# Conflicts:
#	src/compiler/diagnosticMessages.json
#	tests/baselines/reference/functionTypeArgumentAssignmentCompat.errors.txt
#	tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.errors.txt
#	tests/baselines/reference/mappedTypeRelationships.errors.txt
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.

Issue a custom error message when trying to assign constraint type to generic type parameter
3 participants