-
Notifications
You must be signed in to change notification settings - Fork 15
fix(parity): infer var-typed local types from new-expression initializers in C# #1424
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
Changes from 2 commits
1b98e7f
85ec995
f313268
eb61150
6e143c2
7547c3c
a8cc76a
8ba0470
6d1ba9b
5372758
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| // Regression guard: bare function calls in JS class methods must NOT resolve | ||
| // to same-named class methods. In JS/TS, bare foo() is lexically scoped to | ||
| // the module, not the class — there is no implicit this binding on bare calls. | ||
| // | ||
| // If the call.receiver guard in resolveByMethodOrGlobal (call-resolver.ts) is | ||
| // ever removed, the resolver would incorrectly emit Processor.run → Processor.flush | ||
| // (a false positive). The 1.0 precision floor on the JS fixture catches that | ||
| // regression immediately. | ||
|
|
||
| export function processData(x) { | ||
| return x * 2; | ||
| } | ||
|
|
||
| export class Processor { | ||
| run(x) { | ||
| processData(x); // same-file module-level function — resolves correctly | ||
| flush(); // bare call; no module-level 'flush' in scope — must NOT resolve to Processor.flush | ||
| } | ||
|
|
||
| flush() {} // Processor.flush exists; bare flush() in run() must not target it | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -125,7 +125,8 @@ const THRESHOLDS: Record<string, { precision: number; recall: number }> = { | |||||
| // adds bind/call/apply resolution (3 new edges in bind-call-apply.js), total expected now 33. | ||||||
| // Phase 8.3f adds Object.defineProperty accessor this-dispatch (#1335): getter→baz in | ||||||
| // define-property.js and accessorGetter→accessorTarget.accessMethod in define-property-accessor.js, | ||||||
| // total expected now 35. | ||||||
| // total expected now 35. multi-class.js adds 4 class-scoped typeMap edges → 39. | ||||||
| // #1407 adds class-scope.js (bare-call guard), +1 → total 40. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
| javascript: { precision: 1.0, recall: 0.9 }, | ||||||
| // pts-javascript: hand-authored points-to JS fixture (for-of, Set, Array.from, spread) — patterns | ||||||
| // too broad for the main JS fixture. Patterns split per file to prevent intra-fixture FPs. | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nullwith no diagnostic output. Every other load-failure path in this file sets_loadError, and callers surface the message throughgetNative(). Here the error is recorded but there's nodebug()call, which means a developer who misspells the path or points to a stale binary will see native silently unavailable with no log hint — even whenDEBUGis enabled.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed — the merge conflict resolution adopted main's version of native.ts (PR #1389), which already includes a
warn()call on the failure path (more visible thandebug()). The original PR's simpler CODEGRAPH_NATIVE_ADDON_PATH approach was superseded by the more complete implementation from main that uses NAPI_RS_NATIVE_LIBRARY_PATH + automatic local binary detection.