Open devxoul opened 5 years ago
Merging #26 into master will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## master #26 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 33 33
=========================================
Hits 33 33
Impacted Files | Coverage Δ | |
---|---|---|
Sources/Umbrella/Umbrella.swift | 100.00% <ø> (ø) |
|
Sources/Umbrella/RuntimeProviderType.swift | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 38c6eb3...a5403bc. Read the comment docs.
Background
Property
parameters
is defined as[String: Any]
which means that you can return any type of value. It can cause a human error when an event has an arbitrary type as an associated value. For example:It would be great if the compiler can warn you.
Solution
Define a protocol
PrimitiveType
which primitive types such asInt
orString
conform to. Use this protocol as a value ofparameters
dictionary so that the compiler can warn you if you return some wrong type.Discussion
It contains a breaking API change. It should be released with the new major version.