shared return type / throws / emits / requires
See original GitHub issueWhen you have a polymorphic function and all its signatures share the same return type/throws/emits/requires, it should be written only once. Obviously only allowed if everything is shared.
e.g.
interface Options {
capture: Boolean,
once: Boolean,
passive Boolean,
mozSystemGroup: Boolean
}
interface addEventListener {
(type: String, listener: Function | Event, Options?),
(type: String, listener: Function | Event, useCapture: Boolean),
(type: String, listener: Function | Event, useCapture: Boolean, wantsUntrusted?: Boolean)
} => Void
/*
} => Type,
throws: ErrorType,
requires: example,
emits: { … }
*/
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
iOS Swift Combine: Emit Publisher with single value
The flatMap operator requires the transform to return a fixed Publisher type, but it doesn't have to return AnyPublisher .
Read more >Error handling in Combine explained with code examples
Error handling in Swift Combine explained by covering operators like mapError, catch, replaceError, assertOnFailure, and how to map to the ...
Read more >ILGenerator.ThrowException(Type) Method - Microsoft Learn
The following code sample demonstrates the contextual usage of ThrowException to throw an exception inside the MSIL of a dynamic method.
Read more >Mono (reactor-core 3.5.1)
Returns a Mono that emits a Boolean value that indicates whether two Publisher sequences are the same by comparing the items emitted by...
Read more >TSConfig Reference - Docs on every TSConfig option
Controls whether TypeScript will emit a byte order mark (BOM) when writing output files. Some runtime environments require a BOM to correctly interpret...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I love this.
Well I won’t address this issue in that PR. Let’s KISS.
Ill just add the alternative form.