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

handle different arity of type params for interfaces #985

Merged
merged 1 commit into from
Apr 15, 2023

Conversation

awareness481
Copy link
Contributor

Description:

Ref: #956

@github-actions
Copy link

Thank you for the PR!
Commit: 1db79be

Files to check

These are files which is affected by the current PR, but not reflected. If there's no file below this message, please ignore this message.

You can run ./scripts/auto-unignore.sh from crates/stc_ts_file_analyzer for typescript files, and ./scripts/check.sh from crates/stc_ts_type_checker for *.stats.rust-debug files.

(Some(a_tps), Some(b_tps)) => {
if a_tps.params.len() != b_tps.params.len() {
self.storage
.report(ErrorKind::InterfaceNonIdenticalTypeParams { span: a.span() }.into());
Copy link
Contributor Author

@awareness481 awareness481 Apr 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

span currently looks like this

interface A<T extends string> {}
────────────────────────────────

is there any way to only use the span of the name of the interface? (like tsc)

interface A<T extends string> {}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add a field like name_span to the Interface type

@awareness481 awareness481 marked this pull request as ready for review April 14, 2023 12:46
@kdy1 kdy1 added this to the v0.0.1: Correctness milestone Apr 14, 2023
Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants