-
Notifications
You must be signed in to change notification settings - Fork 64
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
Add scripts to generate DT compatible definition/test files #191
Comments
See DefinitelyTyped/DefinitelyTyped#15912, at the time I made the needed adjustments but got stuck on failing tests. |
I haven't tried the |
The
Still finding what the cause is 😭 |
That's odd, yeah. Then again, I guess the number of cases where we'd really wanna verify errors is kinda limited, right? |
There's only 7 failing tests, but I'd like to keep them alive unless there's no solution. And I tried Interestingly, if I cut them down: import * as R from "ramda";
// tslint:disable comment-format
// @dts-jest:group and
(() => {
// $ExpectType boolean
R.and(false, true); //=> false
// $ExpectType 0 | never[]
R.and(0, []); //=> 0
// $ExpectType number | never[]
R.and(0)([]); //=> 0
// $ExpectType "" | null
R.and(null, ""); //=> null
})();
// @dts-jest:group or
(() => {
// $ExpectType boolean
R.or(false, true); //=> true
// $ExpectType 0 | never[]
R.or(0, []); //=> []
// $ExpectType number | never[]
R.or(0)([]); //=> []
// $ExpectType "" | null
R.or(null, ""); //=> ''
})(); The output will become:
If I place It seems order matters... |
well, if commenting the error tests would help get us a DT PR in, then whatever I guess. type and_10<T> = {
<U>(b: U): T | U;
}; |
I found the reason why union types didn't unwrapped, they did not pass the |
Why not? Try opening an issue with them explaining the problem to get their take on why they passed |
Opened issue microsoft/dtslint#57, hope they would accept the changes. |
Is this still happening? Is there still uncertainty on how to proceed here, or is the path clear and it's just a matter of actually doing it? |
The infrastructure in this repo is somehow hard to understand, even I as the author sometimes forgot why I wrote some code in that way, I think it's time to rewrite those scripts and also simplify the codegen using some conditional types so that it'd be easier for people to contribute. This PR will be done after it. |
Fair enough. :) |
WIP at
add-scripts-to-generate-dt-compatible
branch.Progress:
$ExpectType
/$ExpectError
)test tests from DT before making a PR to DT, make sure no regression from DT.(should be another issue)The text was updated successfully, but these errors were encountered: