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

Merge main for Calculation PR #1

Merged
merged 2,866 commits into from
Jun 1, 2024
Merged

Merge main for Calculation PR #1

merged 2,866 commits into from
Jun 1, 2024

Conversation

kungfooman
Copy link

Hey @skeate, this is the first draft to bring your PR closer to HEAD again.

I invested most time into src/compiler/checker.ts and I stumbled over three issues I'm not certain about:

    function getTypeAliasInstantiation(symbol: Symbol, typeArguments: readonly Type[] | undefined, aliasSymbol?: Symbol, aliasTypeArguments?: readonly Type[]): Type {
        const type = getDeclaredTypeOfSymbol(symbol);
        if (type === intrinsicMarkerType && typeArguments) {
            const typeKind = intrinsicTypeKinds.get(symbol.escapedName as string);
            if (typeKind !== undefined && typeArguments.length === 1) {
                return typeKind === IntrinsicTypeKind.NoInfer ? getNoInferType(typeArguments[0]) : getIntrinsicMappingType(symbol, typeArguments[0]);
            }   
            if (typeKind !== undefined && typeArguments.length === 2) {
                return getIntrinsicMappingType2(symbol, typeArguments[0], typeArguments[1]);
            }
        }

In TypeScript HEAD they introduced the typeKind === IntrinsicTypeKind.NoInfer condition during my debugging I couldn't even figure out what its used for, I just reintegrated it into the case of typeArguments.length === 1 - maybe the case for two arguments should also contain it?

  1. I just merged the unit tests, but didn't do anything besides npx hereby local... probably needs more work

  2. (todo ... I will just send now, because I don't know if GitHub even handles more than 2k commits, it just loads indefinitely lol)

jakebailey and others added 30 commits March 15, 2024 14:58
Co-authored-by: Daniel Rosenwasser <[email protected]>
sheetalkamat and others added 26 commits May 13, 2024 16:35
# Conflicts:
#	src/compiler/checker.ts
#	src/compiler/types.ts
#	src/harness/fourslashInterfaceImpl.ts
#	src/lib/es5.d.ts
#	tests/baselines/reference/api/tsserverlibrary.d.ts
#	tests/baselines/reference/api/typescript.d.ts
#	tests/baselines/reference/intrinsicTypes.errors.txt
#	tests/baselines/reference/jsDeclarationsJSDocRedirectedLookups.js
#	tests/baselines/reference/recursiveConditionalTypes.js
#	tests/baselines/reference/recursiveConditionalTypes.types
@kungfooman
Copy link
Author

If you would risk to merge, It would be easier to make further PR's and discussions about the NoInfer question etc.

https://www.totaltypescript.com/noinfer

@kungfooman
Copy link
Author

kungfooman commented Jun 1, 2024

Another merge conflict again, they just reserved the last TypeFlag bit some days ago before it turns negative (1 << 31).toString(2)... didn't test yet if it still works out:

microsoft#58610

image

Edit: just tested, still works with bit 31.

@skeate skeate merged commit 30d3358 into skeate:main Jun 1, 2024
@skeate
Copy link
Owner

skeate commented Jun 1, 2024

Thank you!

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.