Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Abstract accessor with implementation #12560

Copy link
Copy link
@aozgaa

Description

@aozgaa
Issue body actions

TypeScript Version: master, commit 1418fd1

Are abstract getters/setters allowed to have an implementation?

Related: #7184

Code

abstract class A {
    private _a: string;

    abstract get a(): string {
        return this._a;
    }

    abstract set a(newName: string) {
            this._a = newName;
    }
}

Expected behavior:

Error on get and set that abstract getters/setters shouldn't have an implementation.

Actual behavior:

No error.

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptA bug in TypeScript

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.