Skip to content

Instantly share code, notes, and snippets.


Sergey Bugaev bugaevc

Block or report user

Report or block bugaevc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Cluster.swift
class Number /* class cluser */ {
class Int8: Number {
var value: Swift.Int8
init(_ value: Swift.Int8) { self.value = value }
class Int: Number {
var value: Swift.Int
init(_ value: Swift.Int) { self.value = value }
algal / SelfAssigningReferenceTypes.swift
Last active Oct 26, 2017
Brief exploration of Swift classes that assign to self via protocol extensions
View SelfAssigningReferenceTypes.swift
## background
When you write a function that mutates the var properties of a
mutable struct, this _creates a new instance_.[1] As a result,
a variable pointing to a value of this type before the mutation
will still be pointing to the old value after the mutation, as long
as you did not use that variable to do the mutation.
You can’t perform that action at this time.