Skip to content

Fix typos in methods - #2

Merged
Eric Traut (erictraut) merged 1 commit into
microsoft:masterfrom
kinow:typo-in-method
Mar 24, 2019
Merged

Eric Traut (erictraut) merged 1 commit into
microsoft:masterfrom
kinow:typo-in-method

Conversation

@kinow

Copy link
Copy Markdown
Contributor

Sorry, missed one typo in the README file and noticed while preparing this pull request that is a bit trickier than the previous one.

It changes the name of two methods. Used the IDE to alter the methods and find their usages, but not quite sure if that's enough to guarantee I am not breaking anything else.

npm run build passed locally FWIW

Thanks

@erictraut
Eric Traut (erictraut) merged commit d5560b6 into microsoft:master Mar 24, 2019
@giyyapan giyyapan mentioned this pull request Sep 10, 2019
David Foster (davidfstr) added a commit to davidfstr/pyright that referenced this pull request May 7, 2026
Squish to -> Enable TypeForm support by default
Rich Chiodo (rchiodo) pushed a commit that referenced this pull request Jun 25, 2026
* Enable TypeForm support by default

...rather than requiring the --enableExperimentalFeatures bit to be set

* Do not try to interpret a string as a TypeForm unless one is expected

...by the current interence context or because EvalFlags.TypeFormArg is set.

Without this optimization, the call5.py test fails where it defines a
NamedTuple "X", [("a", int), ...]. Attempting to interpret the string "a"
as a forward reference looks up the name `a` (bound by a later for-loop),
and the resulting flow analysis recursively re-enters the Z(...) constructor,
causing a "Class definition for Z depends on itself" error.

* Remove test-output.txt

Squish change to -> Do not try to interpret a string as a TypeForm unless one is expected

* AI Coding: Ignore /plan directory

* Prettier fixes #1

Squish to -> Do not try to interpret a string as a TypeForm unless one is expected

* Prettier fixes #2

Squish to -> Enable TypeForm support by default

* Revert "AI Coding: Ignore /plan directory"

This reverts commit 7233033.

* Squish -> Do not try to interpret a string as a TypeForm unless one is expected

* Add build/perfCompare.py: cross-commit type-check perf benchmark

Adds a dev-facing tool, adapted from mypy's misc/perf_compare.py, that
builds the production pyright CLI bundle at each of two or more commits and
times repeated runs over a fixed corpus, reporting robust winsorized paired
deltas vs a baseline. Supports wall or CPU-time metrics and single-file or
project corpora. Cached bundles live beside the script under
build/perfCompare/binaries/ (gitignored).

Also adds a brief pointer in CONTRIBUTING.md.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* Verify TypeForm inference through container literals

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* Use someSubtypes for short-circuit in expectedTypeWantsTypeForm

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* Decline cloneWithTypeForm short-circuit: measured benefit negligible

Review feedback suggested short-circuiting cloneWithTypeForm with
`if (type.props?.typeForm === typeForm) return type;` (mirroring
cloneForCondition) to avoid allocations on the now-unconditional call
sites. After measuring, this is not worth doing: the no-op case occurs in
only ~0.2% of calls, so the guard would add a branch to the hot path while
saving almost no allocations. No code change is made.

The reference-equality check rarely holds because nearly every call site
passes a freshly-allocated value (e.g. convertToInstance(type)), which is a
new object every time. A value-equality check (isTypeSame) would catch more
cases but costs far more than the allocation it would save, so it is a net
loss on the hot path.

Supporting data (instrumented cloneWithTypeForm over the full
typeEvaluator jest suite, 1,162 tests):

    cloneWithTypeForm calls : ~12,000
    `=== typeForm` would fire:     23  (~0.2%)
      of which both undefined:     22  (~0.18%)
      non-undefined ref match:      1

So the general `=== typeForm` guard buys essentially nothing beyond the
both-undefined case, which is itself only ~0.18% of calls.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* Drop enableExperimentalFeatures from TypeForm tests

Addresses review feedback: the TypeForm tests set enableExperimentalFeatures
= true, so none validated this PR's core claim that TypeForm is enabled by
default. Remove the flag from the existing TypeForm1-8 tests so they all
exercise the default configuration and directly prove the
isTypeFormSupported gate removal is effective.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* Squish -> Do not try to interpret a string as a TypeForm unless one is expected

Fix prettier whitespace issue

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
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.

2 participants