microsoft / microsoft/TypeScript
missing 'used before declaration' error within computed name of accessor or method
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
TypeScript Version: 3.3.0-dev.20181222
Search Terms:
Code
Taken from the tests added in https://github.com/Microsoft/TypeScript/pull/29136
class D {
static A = class extends D.B {
[D.D]() {} // should be an error
}
static B = class {}
static C = {
[D.D]: 1,
...{get [D.D]() {return 0;}} // should be an error
};
static D = '';
[foo]() {} // should have an error
}
let bar = {
[foo]() {} // should have an error
}
let foo = 1;
Expected behavior:
The lines marked with // should be an error should have an error.
Actual behavior:
Currently there's no error at all. After #29136 lands the lines with the comments are missing an error.
Related Issues: #29135
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the tests added in pull request #29136 and the related issue #29135, then reproduce the example with the reported TypeScript version or the Playground link. Done means the marked computed-name cases produce the expected “used before declaration” errors, including accessor and method names.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100