Skip to content
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

在 Scala 使用 BotFactory 遇到 ambiguous reference to overloaded definition #834

Closed
ererermao opened this issue Jan 9, 2021 · 4 comments
Labels
x:question 标签: 需要更多信息

Comments

@ererermao
Copy link

ambiguous reference to overloaded definition,
both value INSTANCE in class BotFactory of type net.mamoe.mirai.BotFactory.INSTANCE
and  class INSTANCE in class BotFactory of type net.mamoe.mirai.BotFactory.INSTANCE.type
match expected type ?
  val bot =  BotFactory.INSTANCE.newBot(11111L, "")

使用scala进行Bot初始化遇到问题,能否帮忙看看?
环境:openjdk:1.8、scala:2.12.12、mirai-core-all:2.0-M2-2

@ererermao ererermao added the x:question 标签: 需要更多信息 label Jan 9, 2021
@Karlatemp
Copy link
Member

Mirai.getInstance().getBotFactoy()

@Him188
Copy link
Member

Him188 commented Jan 9, 2021

Mirai.getInstance().getBotFactory.newBot(11, "")

@Him188 Him188 removed the x:question 标签: 需要更多信息 label Jan 9, 2021
@ererermao
Copy link
Author

Mirai.getInstance().getBotFactory.newBot(11, "")

有用,感谢回复

@Him188
Copy link
Member

Him188 commented Jan 9, 2021

Or

val botFactory: BotFactory = BotFactory.INSTANCE
botFactory.newBot(11, "")

@Him188 Him188 added the x:question 标签: 需要更多信息 label Jan 9, 2021
@Him188 Him188 changed the title ambiguous reference to overloaded definition, 在 Scala 使用 BotFactory 遇到 ambiguous reference to overloaded definition Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:question 标签: 需要更多信息
Projects
None yet
Development

No branches or pull requests

3 participants