Skip to content

Remove the cross-module Generator initializer, and fix invalid tests#174

Merged
mattrubin merged 1 commit into
developfrom
cross-module-initializer-deprecation
Apr 21, 2018
Merged

Remove the cross-module Generator initializer, and fix invalid tests#174
mattrubin merged 1 commit into
developfrom
cross-module-initializer-deprecation

Conversation

@mattrubin

Copy link
Copy Markdown
Owner

Cross-module struct initializers which set properties directly are deprecated in Swift 4.1, and will be an error in Swift 5.

The fact that a custom initializer was needed to construct the invalid Generators used by the test is indicative of a design flaw in the tests. If creating an invalid Generator with the library's default API is not possible, then testing such impossible-to-create invalid Generators is unnecessary. It is enough to test that attempts to create these invalid generators will fail.

Cross-module struct initializers which set properties directly are deprecated in Swift 4.1, and will be an error in Swift 5.
The fact that a custom initializer was needed to construct the invalid Generators used by the test is indicative of a design flaw in the tests. If creating an invalid Generator with the library's default API is not possible, then testing such impossible-to-create invalid Generators is unnecessary. It is enough to test that attempts to create these invalid generators will fail.
@codecov

codecov Bot commented Apr 21, 2018

Copy link
Copy Markdown

Codecov Report

Merging #174 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #174   +/-   ##
========================================
  Coverage    97.19%   97.19%           
========================================
  Files            6        6           
  Lines          392      392           
========================================
  Hits           381      381           
  Misses          11       11

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 859880f...a722b66. Read the comment docs.

@mattrubin mattrubin merged commit eaf2bbf into develop Apr 21, 2018
@mattrubin mattrubin deleted the cross-module-initializer-deprecation branch April 21, 2018 22:46
@mattrubin mattrubin added this to the 3.1.2 milestone Apr 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant