muter-mutation-testing / muter

🔎 Automated mutation testing for Swift 🕳️
MIT License
498 stars 39 forks source link

Failure on implicit return, mistaken for a side effect #160

Closed Nelyus closed 4 years ago

Nelyus commented 4 years ago

I take advantage of swift allowing to drop the return keyword when the methods is a single line.

I have build errors on such methods, when muter remove the statement as part of a RemoveSideEffects mutation:

…/File.swift: error: missing return in a function expected to return `MyType`
rakaramos commented 4 years ago

Hi @Nelyus, thanks for bringing that up! This is going to be a tricky one...from the top of my head I can't think of a anything (maybe SwiftSyntax has some metadata that we can rely on?)

@henrique-morbin-ifood thoughts?

henrique-morbin-ifood commented 4 years ago

Hi @rakaramos, lool, if Muter could understand the syntax, those lines will not even be considered as a mutation, right? So, one thing that comes to me is to identify those kinds of errors and suppress them from the report as if they never existed.