Skip to content

JSDoc: Support @readonly tag #17233

Closed
@ghost

Description

TypeScript Version: nightly (2.5.0-dev.20170712)

Code

class C {
	constructor() {
		/**
		 * @readonly
		 * @type {number}
		 */
		this.x = 0;
	}

	m() {
		this.x = "1"; // Error
		this.x = 1; // No error
	}
}

Expected behavior:

Both lines in m are errors.

Actual behavior:

No error when trying to write to @readonly property.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: JSDocRelates to JSDoc parsing and type generationDomain: JavaScriptThe issue relates to JavaScript specificallyIn DiscussionNot yet reached consensusSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions