dudykr / stc

Speedy TypeScript type checker
https://stc.dudy.dev
Apache License 2.0
5.76k stars 166 forks source link

Feat: Implement this type in method parameter #1062

Closed sunrabbit123 closed 1 year ago

sunrabbit123 commented 1 year ago

Description:

// @strictNullChecks: true
// @declaration: true

class A<T> {
    props: T & { foo: string };
}

class B extends A<{ x: number}> {
    f(p: this["props"]) {
        p.x;
    }
}

BREAKING CHANGE:

Related issue (if exists):

github-actions[bot] commented 1 year ago

Thank you for the PR! Commit: 0833fd0aed798117333e7b0802b74439418a0581

Files to check

These are files which is affected by the current PR, but not reflected. If there's no file below this message, please ignore this message.

You can run ./scripts/auto-unignore.sh from crates/stc_ts_file_analyzer for typescript files, and ./scripts/check.sh from crates/stc_ts_type_checker for *.stats.rust-debug files.