mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
25 lines
448 B
TypeScript
25 lines
448 B
TypeScript
//// [tests/cases/conformance/types/namedTypes/classWithOptionalParameter.ts] ////
|
|
|
|
//// [classWithOptionalParameter.ts]
|
|
// classes do not permit optional parameters, these are errors
|
|
|
|
class C {
|
|
x?: string;
|
|
f?() {}
|
|
}
|
|
|
|
class C2<T> {
|
|
x?: T;
|
|
f?(x: T) {}
|
|
}
|
|
|
|
//// [classWithOptionalParameter.js]
|
|
"use strict";
|
|
// classes do not permit optional parameters, these are errors
|
|
class C {
|
|
f() { }
|
|
}
|
|
class C2 {
|
|
f(x) { }
|
|
}
|