• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16interface I
17{
18    name :string | undefined
19    numeric : boolean | undefined
20}
21
22export class C implements I
23{
24    name : string | undefined = "name"
25    numeric : boolean | undefined = false
26}
27
28export interface I2
29{
30    name :string | undefined
31    numeric : boolean | undefined
32}
33
34export class C2 implements I2
35{
36    name : string | undefined  = "name"
37    numeric : boolean | undefined = false
38}
39
40interface I3
41{
42    name :string
43    numeric : boolean
44}
45
46export class C3 implements I3
47{
48    name : string = "name"
49    numeric : boolean = false
50}
51
52export interface I4
53{
54    name :string
55    numeric : boolean
56}
57
58export class C4 implements I4
59{
60    name : string = "name"
61    numeric : boolean = false
62}
63
64function main(): void {
65    let x:C = new C();
66    let x2:C2 = new C2();
67    let x3:C3 = new C3();
68    let x4:C4 = new C4();
69}
70