-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this
Milestone
Description
Bug Report
getters cannot be async, this quick fix results in a compile error:
π Search Terms
async, get, property
π Version & Regression Information
v4.3.0-dev.20120426
β― Playground Link
Doesn't seem to happen here, needs TS extension in vscode
π» Code
This was the code:
get linuxDistro(): Promise<LinuxDistro> {
if (!isLinux) {
return Promise.resolve(LinuxDistro.Unknown);
}
const file = '/etc/os-release';
return SymlinkSupport.existsFile(file).then(async exists => {
if (!exists) {
return LinuxDistro.Unknown;
}
const buffer = await fsPromises.readFile(file);
const contents = buffer.toString();
if (/NAME="?Fedora"?/.test(contents)) {
return LinuxDistro.Fedora;
} else if (/NAME="?Ubuntu"?/.test(contents)) {
return LinuxDistro.Ubuntu;
} else {
return LinuxDistro.Unknown;
}
});
}
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this