1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/openharmony-arkcompiler_ets_frontend

 / Детали:

[Bug]:Union type of the same type works wrong with undefined in compile time condition.

Предстоит сделать
Владелец
Создано  
26.11.2024

Description:
enum A {
FIRST,
SECOND
}

function foo(x: A): void {
return
}

function bar(a: boolean) {
let x = a ? A.FIRST : A.SECOND
foo(x) // falls with TypeError: Type 'A|A' is not compatible with type 'A' at index 1 [abc.ets:12:9]
}

Error: TypeError: Type 'A|A' is not compatible with type 'A' at index 1

Комментарий (0)

GitLife Service Account Задача создана
GitLife Service Account добавлено
 
waiting_for_assign
label.
Развернуть журнал операций

Вход Перед тем как оставить комментарий

Статус
Ответственный
Контрольная точка
Pull Requests
Связанные запросы на слияние могут быть закрыты после их объединения
Ветки
Дата начала   -   Крайний срок
-
Закрепить/Открепить
Приоритет
Участники(1)
1
https://api.gitlife.ru/oschina-mirror/openharmony-arkcompiler_ets_frontend.git
git@api.gitlife.ru:oschina-mirror/openharmony-arkcompiler_ets_frontend.git
oschina-mirror
openharmony-arkcompiler_ets_frontend
openharmony-arkcompiler_ets_frontend