V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
zhwguest
V2EX  ›  Kotlin

请大佬帮忙看一眼我这个注解为什么没能抑制 never used 警告?

  •  
  •   zhwguest · 91 天前 · 951 次点击
    这是一个创建于 91 天前的主题,其中的信息可能已经有所发展或是发生改变。
    @Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER)
    @Retention(AnnotationRetention.SOURCE)
    @Suppress("unused", "CanBePrivate")
    annotation class Api
    

    还是被警告了

    1 条回复    2024-01-30 16:59:10 +08:00
    LiYing2016
        1
    LiYing2016  
       88 天前
    直接把 `@Suppress` 写在 `fun sendText` 上试试
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   949 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 19:35 · PVG 03:35 · LAX 12:35 · JFK 15:35
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.