Giter VIP home page Giter VIP logo

Comments (6)

ilyapuchka avatar ilyapuchka commented on May 21, 2024 1

We may store them like [TypeName: Type], but I'm not sure we will get something from storing actual type references, because what we need is just to check if the type name is inside the implementing types collection and not to access the metadata of those types. At least I don't see it useful right now.

from sourcery.

krzysztofzablocki avatar krzysztofzablocki commented on May 21, 2024

I'll add it 👍

from sourcery.

krzysztofzablocki avatar krzysztofzablocki commented on May 21, 2024

This will be needed for the following to work properly:

protocol AutoEquatable {}

struct AStruct: Equatable {
  public static func == (l: AStruct, r: AStruct) -> Bool {
    return true
  }
}

struct Book: AutoEquatable {
  let aStruct: AStruct
}

Given template like

{% for type in types.implementing.AutoEquatable %}
  {% for variable in type.storedVariables %}
    {% if variable.type.inheritedTypes.AutoEquatable %}
      {{ variable.type }}
    {% endif %}
  {% endfor %}
{% endfor %}

It should not generate code

from sourcery.

ilyapuchka avatar ilyapuchka commented on May 21, 2024

Ah, so if inheritedTypes is just an array of strings we can not use it in if type.inheritedTypes.SomeType? Then looks like those collections should be "dummy" dictionaries like ["TypeName": "TypeName"]?

from sourcery.

krzysztofzablocki avatar krzysztofzablocki commented on May 21, 2024

well right now we don't store real types in inheritedTypes, and I think we want to because with flattening types it will be much more reliable right?

from sourcery.

krzysztofzablocki avatar krzysztofzablocki commented on May 21, 2024

Implemneted in 0.4.1

from sourcery.

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.