Code Monkey home page Code Monkey logo

Comments (9)

segiddins avatar segiddins commented on May 16, 2024

Wouldn't you also need to check if any mutating methods /input functions are called with it?

from swiftlint.

marcelofabri avatar marcelofabri commented on May 16, 2024

Yeah, this will be a trick one. We can't also predict anything on properties from public API (they might not change inside the file itself, but a consumer may change it).

from swiftlint.

marcelofabri avatar marcelofabri commented on May 16, 2024

An easier way to do this is trying to replace every (non-public?) var with let and let the compiler check if it's still ok.

The problems are that this will probably be much slower and that neither syntax nor structure expose this error (but swiftc does).

from swiftlint.

jpsim avatar jpsim commented on May 16, 2024

@mrackwitz is working on a parser for swiftc -dump-ast so hopefully that'll make it easier to build different kinds of SwiftLint rules based on that version of the AST.

from swiftlint.

marcelofabri avatar marcelofabri commented on May 16, 2024

👍

I was just about to comment about swiftc -dump-ast and how helpful it would be.

from swiftlint.

marcelofabri avatar marcelofabri commented on May 16, 2024

This is now a compiler warning on Swift 2.0, so maybe it should be closed.

from swiftlint.

jpsim avatar jpsim commented on May 16, 2024

This is now a compiler warning on Swift 2.0, so maybe it should be closed.

Agreed. Plus, this would have been difficult to do without LLMV IR access.

from swiftlint.

cprovatas avatar cprovatas commented on May 16, 2024

Any chance of supporting this for class / struct properties? I noticed the swift compiler doesn't catch this. Is it too complex to support?

from swiftlint.

jpsim avatar jpsim commented on May 16, 2024

It would be possible to build an analyzer rule to do that.

from swiftlint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.