• 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 Todo {
17    teTodo(todo1, {
18        description: string;
19    }
20
21    function updateTodo(todo:Todo, fieldToUpdate: Partial<Todo>) {
22        return {...todo, ...fieldToUpdate };
23    }
24
25/* @@? 17:17 Error SyntaxError: Parameter declaration should have an explicit type annotation. */
26/* @@? 17:19 Error SyntaxError: Unexpected token, expected an identifier. */
27/* @@? 17:19 Error SyntaxError: Parameter declaration should have an explicit type annotation. */
28/* @@? 17:19 Error SyntaxError: Unexpected token, expected ',' or ')'. */
29/* @@? 18:22 Error SyntaxError: Label must be followed by a loop statement. */
30/* @@? 18:22 Error TypeError: Type name 'string' used in the wrong context */
31/* @@? 21:14 Error SyntaxError: Unexpected token, expected ','. */
32/* @@? 21:14 Error SyntaxError: Unexpected token, expected 'private' or identifier. */
33/* @@? 21:25 Error TypeError: Cannot find type 'todo'. */
34/* @@? 21:29 Error SyntaxError: Unexpected token, expected ','. */
35/* @@? 21:29 Error SyntaxError: Unexpected token, expected 'private' or identifier. */
36/* @@? 21:34 Error SyntaxError: Interface fields must have type annotation. */
37/* @@? 21:36 Error TypeError: Cannot find type 'fieldToUpdate'. */
38/* @@? 21:49 Error SyntaxError: Unexpected token, expected 'private' or identifier. */
39/* @@? 21:49 Error SyntaxError: Unexpected token, expected ','. */
40/* @@? 21:64 Error SyntaxError: Unexpected token, expected '('. */
41/* @@? 21:66 Error SyntaxError: Unexpected token, expected ',' or ')'. */
42/* @@? 21:66 Error SyntaxError: Parameter declaration should have an explicit type annotation. */
43/* @@? 21:66 Error SyntaxError: Unexpected token, expected an identifier. */
44/* @@? 22:16 Error TypeError: need to specify target type for class composite */
45/* @@? 46:1 Error SyntaxError: Unexpected token, expected '}'. */
46