2 # frozen-string-literal: true
8 # warn(*msgs, uplevel: nil, category: nil) -> nil
10 # If warnings have been disabled (for example with the
11 # <code>-W0</code> flag), does nothing. Otherwise,
12 # converts each of the messages to strings, appends a newline
13 # character to the string if the string does not end in a newline,
14 # and calls Warning.warn with the string.
16 # warn("warning 1", "warning 2")
23 # If the <code>uplevel</code> keyword argument is given, the string will
24 # be prepended with information for the given caller frame in
25 # the same format used by the <code>rb_warn</code> C function.
29 # warn("invalid call to foo", uplevel: 1)
40 # baz.rb:6: warning: invalid call to foo
42 # If <code>category</code> keyword argument is given, passes the category
43 # to <code>Warning.warn</code>. The category given must be be one of the
44 # following categories:
46 # :deprecated :: Used for warning for deprecated functionality that may
47 # be removed in the future.
48 # :experimental :: Used for experimental features that may change in
50 def warn(*msgs, uplevel: nil, category: nil)
51 Primitive.rb_warn_m(msgs, uplevel, category)