From fd22c715fb162810523c134911b5ebf183e3a6a8 Mon Sep 17 00:00:00 2001 From: Igor Loginov Date: Mon, 2 Jun 2025 16:47:19 +0300 Subject: [PATCH] Repropduce circular dependency bug --- arkoala-arkts/trivial/user/src/ets/page2.ets | 56 ++------------- arkoala-arkts/trivial/user/src/ets/page3.ets | 68 +------------------ .../libarkts/src/arkts-api/ProgramProvider.ts | 2 + 3 files changed, 9 insertions(+), 117 deletions(-) diff --git a/arkoala-arkts/trivial/user/src/ets/page2.ets b/arkoala-arkts/trivial/user/src/ets/page2.ets index 1be753eae..0a4485ba1 100644 --- a/arkoala-arkts/trivial/user/src/ets/page2.ets +++ b/arkoala-arkts/trivial/user/src/ets/page2.ets @@ -13,58 +13,12 @@ * limitations under the License. */ -import { Button, Column, ColumnOptions, ClickEvent, State, PageTransitionEnter, PageTransitionExit, PageTransitionOptions } from "@ohos.arkui" +import { C } from "./page3" -import router from '@ohos.router' +export struct S { + x: number = 4 -function nLog(message: string) { - console.log(message) -} - -@Component -@Entry -struct Page2 { - @State value: number = 11 - onPageShow() { - nLog('Page2 onPageShow()') - } - - onPageHide() { - nLog('Page2 onPageHide()') - } - - aboutToAppear() { - nLog('Page2 aboutToAppear()') - } - - aboutToDisappear() { - nLog('Page2 aboutToDisappear()') - } - build() { - nLog(`In Page2 build()`) - Column({}) { - Button("Click") - .width(200).height(100) - .backgroundColor('#ff0000') - .onClick((e?: ClickEvent) => { - this.value++ - nLog(`Page2: clicked ${this.value}`) - }) - Button("Back") - .width(200).height(100) - .backgroundColor('#ff0000') - .onClick((e?: ClickEvent) => { - nLog(`Page2: back clicked`) - router.back() - }) - } - } - - @Builder - pageTransition() { - // TODO: now lambda type inference cannot handle literal wrapping. - PageTransitionEnter({ duration: 100 } as PageTransitionOptions) - PageTransitionExit({ duration: 100 } as PageTransitionOptions) + m() { + this.x = 19 } } - diff --git a/arkoala-arkts/trivial/user/src/ets/page3.ets b/arkoala-arkts/trivial/user/src/ets/page3.ets index 4e2e90443..a52eb52a8 100644 --- a/arkoala-arkts/trivial/user/src/ets/page3.ets +++ b/arkoala-arkts/trivial/user/src/ets/page3.ets @@ -1,69 +1,5 @@ -/* - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +import { S } from "./page2" -import router from '@ohos.router' -import { Button, Column, ColumnOptions, ClickEvent, State, PageTransitionEnter, PageTransitionExit, PageTransitionOptions } from "@ohos.arkui" +export class C { -function nLog(message: string) { - console.log(message) } - -@Component -@Entry -struct Page3 { - @State value: number = 11 - onPageShow() { - nLog('Page3 onPageShow()') - } - - onPageHide() { - nLog('Page3 onPageHide()') - } - - aboutToAppear() { - nLog('Page3 aboutToAppear()') - } - - aboutToDisappear() { - nLog('Page3 aboutToDisappear()') - } - build() { - nLog(`In Page3 build()`) - Column({}) { - Button("Click") - .width(200).height(100) - .backgroundColor('#ff0000') - .onClick((e?: ClickEvent) => { - this.value++ - nLog(`Page3: clicked ${this.value}`) - }) - Button("Go") - .width(200).height(100) - .backgroundColor('#ff0000') - .onClick((e?: ClickEvent) => { - nLog(`Page3: Go clicked`) - router.push({ url: "page2" }) - }) - } - } - - @Builder - pageTransition() { - // TODO: now lambda type inference cannot handle literal wrapping. - PageTransitionEnter({ duration: 100 } as PageTransitionOptions) - PageTransitionExit({ duration: 100 } as PageTransitionOptions) - } -} - diff --git a/ui2abc/libarkts/src/arkts-api/ProgramProvider.ts b/ui2abc/libarkts/src/arkts-api/ProgramProvider.ts index f73298098..1e2f5fd81 100644 --- a/ui2abc/libarkts/src/arkts-api/ProgramProvider.ts +++ b/ui2abc/libarkts/src/arkts-api/ProgramProvider.ts @@ -30,6 +30,8 @@ export class ProgramProvider { const listed = listPrograms(this.mainProgram.program, this.filter) for (const program of listed) { if (!this.seenPrograms.has(program.program.peer)) { + if (!program.name.includes("page2") && !program.name.includes("page3")) continue + console.log(program.name) this.seenPrograms.add(program.program.peer) this.queue.push(program) } -- Gitee