Skip to content

Commit

Permalink
Correct access level for extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisMyrants committed Feb 20, 2018
1 parent 4f137bf commit ad890c1
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Equatable.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% for type in types.all|annotated:"equatable"|!enum|!protocol %}

extension {{ type.name }}: Equatable {
public static func == (lhs: {{ type.name }}, rhs: {{ type.name }}) -> Bool {
{{ type.accessLevel }} static func == (lhs: {{ type.name }}, rhs: {{ type.name }}) -> Bool {
{% for var in type.variables|!static|!computed %}
{% if var.actualTypeName.name == "Error" %}
guard "\(lhs.{{ var.name }})" == "\(rhs.{{ var.name }})" else { return false }
Expand All @@ -26,7 +26,7 @@ extension {{ type.name }}: Equatable {
{% for type in types.enums|annotated:"equatable" %}

extension {{ type.name }}: Equatable {
public static func == (lhs: {{ type.name }}, rhs: {{ type.name }}) -> Bool {
{{ type.accessLevel }} static func == (lhs: {{ type.name }}, rhs: {{ type.name }}) -> Bool {
switch (lhs,rhs) {
{% for case in type.cases %}
{% if case.hasAssociatedValue %}case (.{{ case.name }}(let lhs), .{{ case.name }}(let rhs)):{% else %}case (.{{ case.name }}, .{{ case.name }}):{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion Init.stencil
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% for type in types.structs|!enum|!protocol %}
// sourcery:inline:{{ type.name }}.Init
public init({% for var in type.variables|!static|!computed %}{{ var.name }}: {{ var.actualTypeName }}{% if not forloop.last %}, {% endif %}{% endfor %}) {
{{ type.accessLevel }} init({% for var in type.variables|!static|!computed %}{{ var.name }}: {{ var.actualTypeName }}{% if not forloop.last %}, {% endif %}{% endfor %}) {
{% for var in type.variables|!static|!computed %}
self.{{ var.name }} = {{ var.name }}
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion Lens.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

{% for type in types.structs|annotated:"lens" %}

public extension {{ type.name }} {
{{ type.accessLevel }} extension {{ type.name }} {
enum lens {
{% for var in type.variables|!static|!computed %}

Expand Down
2 changes: 1 addition & 1 deletion Match.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

{% for type in types.enums|annotated:"match" where type.cases.count > 0 %}

public extension {{ type.name }} {
{{ type.accessLevel }} extension {{ type.name }} {
func match<ReturnedType>(
{% for case in type.cases %}
{{ case.name }}: {% if case.associatedValues.count > 0 %}({% for associated in case.associatedValues %}{{ associated.actualTypeName }}{% if forloop.last %}{% else %}, {% endif %}{% endfor %}){% else %}(){% endif %} -> ReturnedType{% if forloop.last %}{% else %}, {% endif %}
Expand Down
2 changes: 1 addition & 1 deletion Prism.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

{% for type in types.enums|annotated:"prism" %}

public extension {{ type.name }} {
{{ type.accessLevel }} extension {{ type.name }} {
enum prism {
{% for case in type.cases %}

Expand Down

0 comments on commit ad890c1

Please sign in to comment.