| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ffdd2a4 commit e5034d9
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,14 +36,17 @@ extension B { // $ access=B | |||
| 36 | 36 | } | |
| 37 | 37 | } | |
| 38 | 38 | ||
| 39 | - // Inheritance through extension | ||
| 40 | - class Base { | ||
| 41 | - func baseMethod() { | ||
| 42 | - } | ||
| 39 | + // Protocol conformance through extension | ||
| 40 | + protocol Base { | ||
| 41 | + func baseMethod(); | ||
| 42 | + } | ||
| 43 | + extension Base { // $ access=Base | ||
| 44 | + func baseMethodExt() {} // name=Base.baseMethodExt | ||
| 43 | 45 | } | |
| 44 | 46 | class X { | |
| 45 | 47 | func xMethod() { | |
| 46 | 48 | baseMethod() // $ access=Base.baseMethod | |
| 49 | + baseMethodExt() // $ access=Base.baseMethodExt | ||
| 47 | 50 | } | |
| 48 | 51 | } | |
| 49 | 52 | extension X : Base {} // $ access=X access=Base | |
| Back | FazBrowse Home | New Git URL |
0 commit comments