mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
* AccessorDecl and EnumElementDecl aren't independent decls * DestructorDecl and EnumCaseDecl can't be put in extension
45 lines
570 B
Plaintext
45 lines
570 B
Plaintext
class Foo {
|
|
|
|
|
|
func methodWithParameters(param1: Foo, param2: Foo) {
|
|
}
|
|
|
|
@discardableResult
|
|
private func privateMethodWithAnnotation() -> Foo? {
|
|
return nil
|
|
}
|
|
|
|
var anInstanceVariable: String?
|
|
|
|
func justAnotherMethod() {
|
|
}
|
|
}
|
|
|
|
extension Foo {
|
|
/// This is just some documentation
|
|
func methodWithoutParameters() {
|
|
}
|
|
}
|
|
|
|
class OtherClass {
|
|
func foo() {
|
|
}
|
|
|
|
var computedVariable: Int {
|
|
return 0
|
|
}
|
|
|
|
var computedVariable2: Int {
|
|
get { return 0 }
|
|
set { }
|
|
}
|
|
|
|
deinit { print("deinit") }
|
|
}
|
|
|
|
enum MyEnum {
|
|
case foo, bar
|
|
case baz
|
|
}
|
|
|