Movatterモバイル変換


[0]ホーム

URL:


Scala 3
3.7.4
LearnInstallPlaygroundFind A LibraryCommunityBlog
Scala 3
LearnInstallPlaygroundFind A LibraryCommunityBlog
DocsAPI
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL
Scala 3/scala/scala.annotation/nowarn

nowarn

scala.annotation.nowarn
classnowarn(value:String = ...) extendsConstantAnnotation

An annotation for local warning suppression.

The optionalvalue parameter allows selectively silencing messages, seescalac -Wconf:help for help. Examples:

def f = {  1: @nowarn // don't warn "a pure expression does nothing in statement position"  2}@nowarn def f = { 1; deprecated() } // don't warn@nowarn("msg=pure expression does nothing")def f = { 1; deprecated() } // show deprecation warning

To ensure that a@nowarn annotation actually suppresses a warning, enable-Xlint:unused or-Wunused:nowarn. The unused annotation warning is emitted in categoryunused-nowarn and can be selectively managed using-Wconf:cat=unused-nowarn:s.

Attributes

Source
nowarn.scala
Graph
Supertypes
classObject
traitMatchable
classAny
Show all
In this article
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL

[8]ページ先頭

©2009-2025 Movatter.jp