onekiloparsec / SwiftAA

The most comprehensive collection of accurate astronomical algorithms in (C++, Objective-C and) Swift.
http://www.onekiloparsec.dev/
MIT License
172 stars 31 forks source link

made fatalError() drop-in replacement internal (instead of public) #72

Closed alex-vasenin closed 6 years ago

alex-vasenin commented 6 years ago

It's a very bad idea to introduce public function with the exact same name as standard Swift function. Declaring such function does not override system function Swift.fatalError(), but merely creates a new function SwiftAA.fatalError() with the same signature. Since local scope take precedence, calling unqualified fatalError() from SwiftAA module will call local function. However, if you call unqualified fatalError() from other module which has SwiftAA imported, swift compiler would not be able to infer which function to call, Swift.fatalError() or SwiftAA.fatalError() and you'll get Ambiguous use of 'fatalError(_:file:line:)' error on every fatalError call.

codecov[bot] commented 6 years ago

Codecov Report

Merging #72 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #72   +/-   ##
=======================================
  Coverage   91.26%   91.26%           
=======================================
  Files          41       41           
  Lines        1465     1465           
=======================================
  Hits         1337     1337           
  Misses        128      128
Impacted Files Coverage Δ
SwiftAA/Constants.swift 100% <100%> (ø) :arrow_up:

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 04a0edc...0b53eb3. Read the comment docs.

onekiloparsec commented 6 years ago

You are perfectly right, thanks for checking this out.