Skip to content

Commit

Permalink
update struct, self = erased
Browse files Browse the repository at this point in the history
  • Loading branch information
ytyubox committed Aug 7, 2021
1 parent 8fb32b8 commit d76a9cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ struct AnyGeneric<AnyType>:Generic {

init<G:Generic>(wrappedGeneric: G) where G.AnyType == AnyType {
if let erased = wrappedGeneric as? AnyGeneric<AnyType> {
box = erased.box
self = erased
} else {
box = AnyGenericContainer(wrappedGeneric)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/GenericProtocolVariable/Generic/AnyGeneric.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public struct AnyGeneric<AnyType>: Generic {

public init<GenericType: Generic>(_ generic: GenericType) where AnyType == GenericType.AnyType {
if let erased = generic as? AnyGeneric<AnyType> {
box = erased.box
self = erased
} else {
box = AnyGenericContainer(generic)
}
Expand Down

0 comments on commit d76a9cf

Please sign in to comment.