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 Todo { 17 title: string; 18 teTodo(todo1, { 19 descriptio 20 description: string; 21 } 22 tion:"throw out 23 function updateTodo(todo:Todo, fieldToUpdate: Partial<Todo>) { 24 return {...todo, ...fieldToUpdate }; 25 } 26 27 const todo1: Todo = { 28 title: "original desk", 29 de "ription: "clea, 30 }; 31 32 const todo2 = updateTodo(todo1, { 33 description:"throw out trash", 34 }); 35 36/* @@? 18:15 Error SyntaxError: Parameter declaration should have an explicit type annotation. */ 37/* @@? 18:17 Error SyntaxError: Unexpected token, expected an identifier. */ 38/* @@? 18:17 Error SyntaxError: Parameter declaration should have an explicit type annotation. */ 39/* @@? 18:17 Error SyntaxError: Unexpected token, expected ',' or ')'. */ 40/* @@? 19:5 Error TypeError: Unresolved reference descriptio */ 41/* @@? 20:18 Error SyntaxError: Label must be followed by a loop statement. */ 42/* @@? 20:18 Error TypeError: Type name 'string' used in the wrong context */ 43/* @@? 22:8 Error SyntaxError: Newline is not allowed in strings */ 44/* @@? 22:18 Error SyntaxError: Unexpected token, expected ','. */ 45/* @@? 22:18 Error SyntaxError: Unexpected token, expected 'private' or identifier. */ 46/* @@? 23:65 Error TypeError: need to specify target type for class composite */ 47/* @@? 26:1 Error SyntaxError: Unexpected token, expected 'private' or identifier. */ 48/* @@? 26:1 Error SyntaxError: Unexpected token, expected ','. */ 49/* @@? 26:1 Error SyntaxError: Unexpected token, expected 'private' or identifier. */ 50/* @@? 26:1 Error SyntaxError: Identifier expected. */ 51/* @@? 26:1 Error SyntaxError: Using object literals to declare types in place is not supported. Please declare types and interfaces explicitly! */ 52/* @@? 26:1 Error SyntaxError: Unexpected token, expected ','. */ 53/* @@? 26:1 Error SyntaxError: Interface fields must have type annotation. */ 54/* @@? 27:24 Error SyntaxError: Unexpected token ','. */ 55/* @@? 28:28 Error SyntaxError: Field type annotation expected. */ 56/* @@? 28:28 Error SyntaxError: Unexpected token ','. */ 57/* @@? 28:28 Error SyntaxError: Unexpected token 'ription: '. */ 58/* @@? 31:1 Error SyntaxError: Unexpected token, expected 'private' or identifier. */ 59/* @@? 31:1 Error SyntaxError: Interface fields must have type annotation. */ 60/* @@? 31:1 Error SyntaxError: Unexpected token, expected ','. */ 61/* @@? 31:1 Error SyntaxError: Unexpected token, expected 'private' or identifier. */ 62/* @@? 31:1 Error SyntaxError: Interface fields must have type annotation. */ 63/* @@? 31:1 Error SyntaxError: Using object literals to declare types in place is not supported. Please declare types and interfaces explicitly! */ 64/* @@? 31:1 Error TypeError: Cannot find type 'updateTodo'. */ 65/* @@? 32:36 Error SyntaxError: Unexpected token ','. */ 66/* @@? 33:35 Error SyntaxError: Unexpected token, expected ','. */ 67/* @@? 33:35 Error SyntaxError: Unexpected token, expected 'private' or identifier. */ 68/* @@? 33:35 Error SyntaxError: Identifier expected. */ 69/* @@? 69:67 Error SyntaxError: Unexpected token, expected '}'. */ 70