Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Make sure we do not try and create specific type for non-generics - #1316

Merged
Mikhail Arkhipov (MikhailArkhipov) merged 3 commits into
microsoft:masterfrom
MikhailArkhipov:1291
Jul 12, 2019
Merged

Mikhail Arkhipov (MikhailArkhipov) merged 3 commits into
microsoft:masterfrom
MikhailArkhipov:1291

Conversation

@MikhailArkhipov

Copy link
Copy Markdown

Fixes #1291

  • Make sure we do not try and create specific type for non-generics
  • Cache specific types so we don't create many Foo[Unknown]
  • Fix minor issue when generic type matching didn't work b/c we didn't count self.

MikhailArkhipov added 2 commits July 11, 2019 14:05
Do not create specific types for non-generics
foreach (var m in members) {
switch (m.Value) {
case IPythonTemplateType tt: {
case IPythonTemplateType tt when tt.IsGeneric(): {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Missing when, see similar care below


// For still undefined parameters try matching passed types in order
for (var i = 0; i < args.Arguments.Count; i++) {
for (int i = 0, gtIndex = 0; i < args.Arguments.Count; i++) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

parameter index does not always equal generic parameter index (consider self)

@jakebailey Jake Bailey (jakebailey) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM if the the full suite ends up passing.

@MikhailArkhipov
Mikhail Arkhipov (MikhailArkhipov) merged commit 4a26142 into microsoft:master Jul 12, 2019
Jake Bailey (jakebailey) pushed a commit to jakebailey/python-language-server that referenced this pull request Nov 1, 2019
…crosoft#1316)

* Test

* Cache specific types
Do not create specific types for non-generics
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stuck at analyzing in background and causing high cpu load

2 participants