Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeNameRule should validate associatedtype #956

Closed
marcelofabri opened this issue Dec 10, 2016 · 1 comment
Closed

TypeNameRule should validate associatedtype #956

marcelofabri opened this issue Dec 10, 2016 · 1 comment
Labels
enhancement Ideas for improvements of existing features and rules.

Comments

@marcelofabri
Copy link
Collaborator

Something similar to #955 would be needed.

protocol P {
    associatedtype X
}
$ sourcekitten structure --file file.swift                          
{
  "key.substructure" : [
    {
      "key.kind" : "source.lang.swift.decl.protocol",
      "key.offset" : 0,
      "key.nameoffset" : 9,
      "key.namelength" : 1,
      "key.bodyoffset" : 12,
      "key.bodylength" : 22,
      "key.accessibility" : "source.lang.swift.accessibility.internal",
      "key.runtime_name" : "_TtP8__main__1P_",
      "key.name" : "P",
      "key.length" : 35
    }
  ],
  "key.offset" : 0,
  "key.diagnostic_stage" : "source.diagnostic.stage.swift.parse",
  "key.length" : 36
}

$ sourcekitten syntax --file file.swift
[
  {
    "offset" : 0,
    "length" : 8,
    "type" : "source.lang.swift.syntaxtype.keyword"
  },
  {
    "offset" : 9,
    "length" : 1,
    "type" : "source.lang.swift.syntaxtype.identifier"
  },
  {
    "offset" : 17,
    "length" : 14,
    "type" : "source.lang.swift.syntaxtype.keyword"
  },
  {
    "offset" : 32,
    "length" : 1,
    "type" : "source.lang.swift.syntaxtype.identifier"
  }
]
@marcelofabri marcelofabri added the enhancement Ideas for improvements of existing features and rules. label Dec 10, 2016
@marcelofabri
Copy link
Collaborator Author

Fixed in #955

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Ideas for improvements of existing features and rules.
Projects
None yet
Development

No branches or pull requests

1 participant