sunshinejr / SwiftyUserDefaults

Modern Swift API for NSUserDefaults
http://radex.io/swift/nsuserdefaults/static
MIT License
4.85k stars 366 forks source link

Compiler warning swift 4.2 - All paths through this function will call itself. #169

Closed staticdreams closed 5 years ago

staticdreams commented 5 years ago
screenshot 2018-11-01 at 09 00 45
M0rtyMerr commented 5 years ago

Fix it please

radex commented 5 years ago

@MortMerr It's an open source project. Feel free to contribute.

M0rtyMerr commented 5 years ago

@radex honestly, have no idea how. But it seems like those who wrote this strings should be able to do it quite ez

martinstoyanov commented 5 years ago

@radex so the lib basically can not be used on swift 4.2?

mman commented 5 years ago

@radex can you explain to me what is the getArray and saveArray supposed to do? I'll try to fix it, I'm quite familiar with both NSUserDefaults and swift. I just want to be sure I understand properly the meaning of those methods.

@martinstoyanov the lib can be used on swift 4.2, just avoid calling saveArray and getArray until they are fixed.

minuscorp commented 5 years ago

I'll be glad to propose a PR with the working solution, but I do not recognize that warning as an error at all. It seems more to me that the Swift compiler is misunderstanding the purpose of the methods or am I wrong?

BingXianHanXin commented 5 years ago

循环引用,无法跳出