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

Don't error when calling resolveEntityName #53441

Merged
merged 3 commits into from
Mar 23, 2023
Merged

Don't error when calling resolveEntityName #53441

merged 3 commits into from
Mar 23, 2023

Conversation

gabritto
Copy link
Member

Fixes #53247.

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Mar 22, 2023
@gabritto
Copy link
Member Author

@typescript-bot user test this
@typescript-bot run DT
@typescript-bot test top100

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 22, 2023

Heya @gabritto, I've started to run the diff-based user code test suite on this PR at ed815a1. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 22, 2023

Heya @gabritto, I've started to run the parallelized Definitely Typed test suite on this PR at ed815a1. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 22, 2023

Heya @gabritto, I've started to run the diff-based top-repos suite on this PR at ed815a1. You can monitor the build here.

Update: The results are in!

@@ -45308,7 +45308,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}

meaning |= SymbolFlags.Alias;
const entityNameSymbol = isEntityNameExpression(name) ? resolveEntityName(name, meaning) : undefined;
const entityNameSymbol = isEntityNameExpression(name) ? resolveEntityName(name, meaning, /*ignoreErrors*/ true) : undefined;
Copy link
Member Author

Choose a reason for hiding this comment

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

It's my understanding that we expect that this resolveEntityName call might fail, judging from the if statement below and the rest of the code (and an earlier resolve call that also ignores errors)`, so we shouldn't report errors here.

@typescript-bot
Copy link
Collaborator

@gabritto Here are the results of running the user test suite comparing main and refs/pull/53441/merge:

Everything looks good!

Comment on lines 13 to 17
//// const x = Foo.makeFoo<{}>; //// Cannot find name 'Foo'.ts(2304)
//// //// 'Foo' only refers to a type, but
//// //// is being used as a namespace here.ts(2702)

//// x({}); // 👍 `const x: <{}>(context: {}) => <T>(value: T) => Foo<T, {}>`
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 the comments are helpful for the issue, but are confusing here for the test case.

@DanielRosenwasser
Copy link
Member

getSymbolAtLocation is supposed to be language servicey. Unfortunately

  1. we use it elsewhere in the checker, so some real-world tests might catch something and are worth running.
  2. we don't have real world language service consistency tests. :(

least we can do is test for stability/speed in the language service.

@typescript-bot user test tsserver
@typescript-bot test tsserver top100

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 22, 2023

Heya @DanielRosenwasser, I've started to run the diff-based user code test suite (tsserver) on this PR at ed815a1. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 22, 2023

Heya @DanielRosenwasser, I've started to run the diff-based top-repos suite (tsserver) on this PR at ed815a1. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser Here are the results of running the user test suite comparing main and refs/pull/53441/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

Hey @gabritto, the results of running the DT tests are ready.
Everything looks the same!
You can check the log here.

@typescript-bot
Copy link
Collaborator

@gabritto Here are the results of running the top-repos suite comparing main and refs/pull/53441/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser Here are the results of running the top-repos suite comparing main and refs/pull/53441/merge:

Everything looks good!

@gabritto gabritto merged commit d5fd34b into main Mar 23, 2023
@gabritto gabritto deleted the gabritto/issue53247 branch March 23, 2023 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Instantiation Expressions from generic class static member
4 participants