New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ambigous use of register #94
Comments
import Foundation
import thrio
class SwiftPageObserver: NSObject, NavigatorPageObserverProtocol {
}
class SwiftRouteObserver: NSObject, NavigatorRouteObserverProtocol {
}
class SwiftModule: ThrioModule {
override func onModuleInit() {
}
override func onPageRegister() {
_ = register(SwiftPageObserver())
_ = register(SwiftRouteObserver())
_ = register({ (params) -> UIViewController? in
if #available(iOS 13.0, *) {
return UIHostingController(rootView: Page5View())
} else {
return UIViewController()
}
}, forUrl: "/biz1/swift1")
}
}
` |
这样试试,返回值要忽略的话,得 _ 下 |
foxsofter
added
the
more-information-needed
Please provide more information so we can reproduce the issue, thank you!
label
Nov 2, 2020
请查看main分支的Swift相关的demo |
可能是我使用的问题,如果register()方法传递的参数同时继承或者实现了ThrioModule, NavigatorRouteObserverProtocol, NavigatorPageObserverProtocol 中的两个,就会有问题,否则就能编译通过 |
no-response
bot
removed
the
more-information-needed
Please provide more information so we can reproduce the issue, thank you!
label
Nov 3, 2020
我试了下,不会报错 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
如图所示,OC代码转化为相应的swift代码后,以下三个方法具有相同的方法签名
造成编译器无法区分要调用哪一个函数
macOS:10.15.7
XCode: Version 12.1 (12A7403)
swift: swift5
thrio:thrio: ^0.5.1
Flutter 1.20.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision fba99f6cf9 (6 weeks ago) • 2020-09-14 15:32:52 -0700
Engine • revision d1bc06f032
Tools • Dart 2.9.2
The text was updated successfully, but these errors were encountered: