Skip to content

Commit 708f2e8

Browse files
Moving Warning related methods out of Any (#13978)
1 parent 1b12470 commit 708f2e8

File tree

4 files changed

+46
-49
lines changed

4 files changed

+46
-49
lines changed

distribution/lib/Standard/Base/0.0.0-dev/docs/api/Any.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
- >= self that:Standard.Base.Any.Any -> Standard.Base.Any.Any
1010
- catch self error_type:Standard.Base.Any.Any= handler:Standard.Base.Any.Any= -> Standard.Base.Any.Any
1111
- catch_primitive self handler:Standard.Base.Any.Any -> Standard.Base.Any.Any
12-
- has_warnings self warning_type:Standard.Base.Any.Any= -> Standard.Base.Any.Any
1312
- if_not_error self ~other:Standard.Base.Any.Any -> Standard.Base.Any.Any
1413
- if_not_nothing self ~action:Standard.Base.Any.Any -> Standard.Base.Any.Any
1514
- if_nothing self ~other:Standard.Base.Any.Any -> Standard.Base.Any.Any
@@ -18,8 +17,6 @@
1817
- map_error self ~f:Standard.Base.Any.Any -> Standard.Base.Any.Any
1918
- map_nothing self f:Standard.Base.Any.Any -> Standard.Base.Any.Any
2019
- pretty self -> Standard.Base.Any.Any
21-
- remove_warnings self warning_type:Standard.Base.Any.Any= -> Standard.Base.Any.Any
22-
- throw_on_warning self warning_type:Standard.Base.Any.Any= -> Standard.Base.Any.Any
2320
- to self target_type:Standard.Base.Any.Any -> Standard.Base.Any.Any
2421
- to_display_text self -> Standard.Base.Any.Any
2522
- to_text self -> Standard.Base.Any.Any

distribution/lib/Standard/Base/0.0.0-dev/docs/api/Warning.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@
2222
- get_all_vector value:Standard.Base.Any.Any should_wrap:Standard.Base.Any.Any -> Standard.Base.Any.Any
2323
- map_attached_warnings_helper mapper:Standard.Base.Any.Any value:Standard.Base.Any.Any frames_to_drop:Standard.Base.Any.Any -> Standard.Base.Any.Any
2424
- set_array value:Standard.Base.Any.Any warnings:Standard.Base.Any.Any -> Standard.Base.Any.Any
25+
- Standard.Base.Any.Any.has_warnings self warning_type:Standard.Base.Any.Any= -> Standard.Base.Any.Any
26+
- Standard.Base.Any.Any.remove_warnings self warning_type:Standard.Base.Any.Any= -> Standard.Base.Any.Any
27+
- Standard.Base.Any.Any.throw_on_warning self warning_type:Standard.Base.Any.Any= -> Standard.Base.Any.Any

distribution/lib/Standard/Base/0.0.0-dev/src/Any.enso

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -572,49 +572,3 @@ type Any
572572
In these contexts we recommend using `|>`.
573573
|> : (Any -> Any) -> Any
574574
|> self ~function = function self
575-
576-
## ---
577-
group: Errors
578-
icon: metadata
579-
---
580-
Checks if any warnings (either all or of a specified type) are attached to
581-
the value.
582-
583-
## Arguments
584-
- `warning_type`: The type to check if attached to the value. Defaults to
585-
any warning.
586-
has_warnings : Any -> Boolean
587-
has_warnings self warning_type=Any =
588-
_ = warning_type
589-
False
590-
591-
## ---
592-
group: Errors
593-
icon: warning
594-
---
595-
Remove the warnings (either all or of a specified type) attached to the
596-
value.
597-
598-
## Arguments
599-
- `warning_type`: The type to remove if attached to the value. Defaults
600-
to all warnings.
601-
remove_warnings : Any -> Any
602-
remove_warnings self warning_type=Any =
603-
_ = warning_type
604-
self
605-
606-
## ---
607-
group: Errors
608-
icon: error
609-
---
610-
Throws the first matching warning (either all or of a specified type) as a
611-
data flow error.
612-
613-
## Arguments
614-
- `warning_type`: The type to throw if attached to the value. Defaults to
615-
all warnings.
616-
throw_on_warning : Any -> Any
617-
throw_on_warning self warning_type=Any =
618-
_ = warning_type
619-
self
620-

distribution/lib/Standard/Base/0.0.0-dev/src/Warning.enso

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,3 +357,46 @@ map_attached_warnings_helper mapper value frames_to_drop =
357357
original (unwrapped) warning instance.
358358
Nothing -> warning
359359
Warning.set value mapped_warnings
360+
361+
362+
## ---
363+
group: Errors
364+
icon: metadata
365+
---
366+
Checks if any warnings (either all or of a specified type) are attached to
367+
the value.
368+
369+
## Arguments
370+
- `warning_type`: The type to check if attached to the value. Defaults to
371+
any warning.
372+
Any.has_warnings self warning_type=Any =
373+
_ = warning_type
374+
False
375+
376+
## ---
377+
group: Errors
378+
icon: warning
379+
---
380+
Remove the warnings (either all or of a specified type) attached to the
381+
value.
382+
383+
## Arguments
384+
- `warning_type`: The type to remove if attached to the value. Defaults
385+
to all warnings.
386+
Any.remove_warnings self warning_type=Any =
387+
_ = warning_type
388+
self
389+
390+
## ---
391+
group: Errors
392+
icon: error
393+
---
394+
Throws the first matching warning (either all or of a specified type) as a
395+
data flow error.
396+
397+
## Arguments
398+
- `warning_type`: The type to throw if attached to the value. Defaults to
399+
all warnings.
400+
Any.throw_on_warning self warning_type=Any =
401+
_ = warning_type
402+
self

0 commit comments

Comments
 (0)