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

fix(28516): Abstract methods should not allow async modifier #39963

Merged
merged 1 commit into from
Sep 4, 2020

Conversation

a-tarasyuk
Copy link
Contributor

Fixes #28516

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Aug 8, 2020
Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

This is a breaking change, so I'm marking it as such. However, I couldn't find any examples of its use on my hard drive, which has a lot of TS and JS on it. =)

@sandersn sandersn added the Breaking Change Would introduce errors in existing code label Sep 4, 2020
@sandersn sandersn merged commit 09d68ef into microsoft:master Sep 4, 2020
@MikeMitterer
Copy link

And now??? How should we implement a concrete async function in an abstract class???

This seems not be possible anymore:

export abstract class Base {
    public abstract getName(): string;
    
    public async getAge(): Promise<number> {
        return await fetchAgeFromServer()
    }
}

class Real extends Base {
    getName(): string {
        return 'MyName';
    }
}

josephaxisa added a commit to looker-open-source/sdk-codegen that referenced this pull request Dec 21, 2020
jkaster added a commit to looker-open-source/sdk-codegen that referenced this pull request Dec 21, 2020
* Bumped TypeScript version to 4.1.3

* Removed async modifier from abstract method

This was a breaking change as of TS 4.x: microsoft/TypeScript#39963

More context:
microsoft/TypeScript#25710 (comment)

* Removed ts-node from non-root package.json files

* Added test:sdk script to root package.json

* Fixed specConverter paths

* Fixed logical error in declarationMiner.spec.ts

* yarn.lock

* Fix root path resolution for sdk-rtl testUtils.ts

Co-authored-by: John Kaster <kaster@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Change Would introduce errors in existing code For Backlog Bug PRs that fix a backlog bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Abstract methods should not allow async modifier
4 participants