1/* 2 * Copyright (c) 2024-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 16export declare const byte_1: byte = -127 as byte, byte_2: byte = 126 as byte; 17export declare const byte_12: byte = -127 + 1, byte_22: byte = 126 - 1; 18export declare const byte_13: byte = Byte.MIN_VALUE, byte_23: byte = 126; 19export declare const byte_14: byte = new Byte().unboxed() 20export declare const int_1 = 1 + 2 + 3 + 4 21const v = 42 22export declare const int_12 = v 23export declare const int_15: int 24export declare const int_16: int = 12345 25export declare const int_17 = 12345 26export declare const int_18: number = 12345 27declare const x1: int = 5 28declare const x2: int = -5 29declare const y1: float = 5.55 30declare const y2: double = -5.55 31declare const x3: int = 0x5 32declare const x4: int = 0b101 33declare const x5: string = "abc" 34declare const x6: "abc" = "abc" 35declare const x7 = null 36declare const x8 = undefined 37// fllowing pass without CTE 38declare const x11 = 5 39declare const x21 = -5 40declare const y11 = 5.55 41declare const y21 = -5.55 42declare const x31 = 0x5 43declare const x41 = 0b101 44declare const x51 = "abc" 45 46/* @@? 16:37 Error TypeError: Initializers are not allowed in ambient contexts: byte_1 */ 47/* @@? 16:66 Error TypeError: Initializers are not allowed in ambient contexts: byte_2 */ 48/* @@? 17:38 Error TypeError: Initializers are not allowed in ambient contexts: byte_12 */ 49/* @@? 17:64 Error TypeError: Initializers are not allowed in ambient contexts: byte_22 */ 50/* @@? 18:38 Error TypeError: Initializers are not allowed in ambient contexts: byte_13 */ 51/* @@? 18:70 Error TypeError: Initializers are not allowed in ambient contexts: byte_23 */ 52/* @@? 19:38 Error TypeError: Initializers are not allowed in ambient contexts: byte_14 */ 53/* @@? 20:30 Error TypeError: A 'const' initializer in an ambient context must be a string or numeric literal: int_1 */ 54/* @@? 22:31 Error TypeError: A 'const' initializer in an ambient context must be a string or numeric literal: int_12 */ 55/* @@? 24:36 Error TypeError: Initializers are not allowed in ambient contexts: int_16 */ 56/* @@? 26:39 Error TypeError: Initializers are not allowed in ambient contexts: int_18 */ 57/* @@? 27:25 Error TypeError: Initializers are not allowed in ambient contexts: x1 */ 58/* @@? 28:25 Error TypeError: Initializers are not allowed in ambient contexts: x2 */ 59/* @@? 29:27 Error TypeError: Initializers are not allowed in ambient contexts: y1 */ 60/* @@? 30:28 Error TypeError: Initializers are not allowed in ambient contexts: y2 */ 61/* @@? 31:25 Error TypeError: Initializers are not allowed in ambient contexts: x3 */ 62/* @@? 32:25 Error TypeError: Initializers are not allowed in ambient contexts: x4 */ 63/* @@? 33:28 Error TypeError: Initializers are not allowed in ambient contexts: x5 */ 64/* @@? 34:27 Error TypeError: Initializers are not allowed in ambient contexts: x6 */ 65/* @@? 35:20 Error TypeError: A 'const' initializer in an ambient context must be a string or numeric literal: x7 */ 66/* @@? 36:20 Error TypeError: A 'const' initializer in an ambient context must be a string or numeric literal: x8 */ 67