V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
zhwguest
V2EX  ›  Kotlin

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

  •  
  •   zhwguest · 2024-01-27 21:25:05 +08:00 · 3143 views
    This topic created in 684 days ago, the information mentioned may be changed or developed.
    @Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER)
    @Retention(AnnotationRetention.SOURCE)
    @Suppress("unused", "CanBePrivate")
    annotation class Api
    

    还是被警告了

    1 replies    2024-01-30 16:59:10 +08:00
    LiYing2016
        1
    LiYing2016  
       2024-01-30 16:59:10 +08:00
    直接把 `@Suppress` 写在 `fun sendText` 上试试
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2729 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 14:57 · PVG 22:57 · LAX 06:57 · JFK 09:57
    ♥ Do have faith in what you're doing.