diff options
author | Simon Ogorodnik <sem-oro@yandex.ru> | 2016-11-28 18:31:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-28 18:31:56 +0300 |
commit | e9cf2d779c03e278ddfd5adb0d1c743961d8d07a (patch) | |
tree | 9fc3ad76cfe1a3b939258fdc005cdd554fbd2562 /core/testdata | |
parent | 17a9a1774ec10690a031ae7afba5f5cfc59a9f24 (diff) | |
parent | 575caeb1cb2a97750f8cc220d3100fc240312671 (diff) | |
download | dokka-e9cf2d779c03e278ddfd5adb0d1c743961d8d07a.tar.gz dokka-e9cf2d779c03e278ddfd5adb0d1c743961d8d07a.tar.bz2 dokka-e9cf2d779c03e278ddfd5adb0d1c743961d8d07a.zip |
Merge pull request #114 from Kotlin/0.9.10/typealias
Type alias support
Diffstat (limited to 'core/testdata')
-rw-r--r-- | core/testdata/format/exceptionClass.md | 2 | ||||
-rw-r--r-- | core/testdata/format/exceptionClass.package.md | 2 | ||||
-rw-r--r-- | core/testdata/format/typeAliases.kt | 27 | ||||
-rw-r--r-- | core/testdata/format/typeAliases.md | 63 | ||||
-rw-r--r-- | core/testdata/format/typeAliases.package.md | 24 | ||||
-rw-r--r-- | core/testdata/javadoc/typealiases.kt | 11 | ||||
-rw-r--r-- | core/testdata/typealias/asTypeBoundWithVariance.kt | 7 | ||||
-rw-r--r-- | core/testdata/typealias/chain.kt | 8 | ||||
-rw-r--r-- | core/testdata/typealias/deprecated.kt | 7 | ||||
-rw-r--r-- | core/testdata/typealias/documented.kt | 9 | ||||
-rw-r--r-- | core/testdata/typealias/functional.kt | 10 | ||||
-rw-r--r-- | core/testdata/typealias/generic.kt | 7 | ||||
-rw-r--r-- | core/testdata/typealias/inheritanceFromTypeAlias.kt | 7 | ||||
-rw-r--r-- | core/testdata/typealias/simple.kt | 5 |
14 files changed, 187 insertions, 2 deletions
diff --git a/core/testdata/format/exceptionClass.md b/core/testdata/format/exceptionClass.md index df3457d7..e3714ecc 100644 --- a/core/testdata/format/exceptionClass.md +++ b/core/testdata/format/exceptionClass.md @@ -2,7 +2,7 @@ # MyException -`class MyException : `[`Exception`](http://docs.oracle.com/javase/6/docs/api/java/lang/Exception.html) +`class MyException : Exception` ### Constructors diff --git a/core/testdata/format/exceptionClass.package.md b/core/testdata/format/exceptionClass.package.md index e27dd0ab..e10478e4 100644 --- a/core/testdata/format/exceptionClass.package.md +++ b/core/testdata/format/exceptionClass.package.md @@ -4,5 +4,5 @@ ### Exceptions -| [MyException](test/-my-exception/index) | `class MyException : `[`Exception`](http://docs.oracle.com/javase/6/docs/api/java/lang/Exception.html) | +| [MyException](test/-my-exception/index) | `class MyException : Exception` | diff --git a/core/testdata/format/typeAliases.kt b/core/testdata/format/typeAliases.kt new file mode 100644 index 00000000..9657963e --- /dev/null +++ b/core/testdata/format/typeAliases.kt @@ -0,0 +1,27 @@ + +class A +class B +class C<T> + +typealias D = A +typealias E = D + +typealias F = (A) -> B + +typealias G = C<A> +typealias H<T> = C<T> + +typealias I<T> = H<T> +typealias J = H<A> + +typealias K = H<J> + +typealias L = (K, B) -> J + +/** + * Documented + */ +typealias M = A + +@Deprecated("!!!") +typealias N = A
\ No newline at end of file diff --git a/core/testdata/format/typeAliases.md b/core/testdata/format/typeAliases.md new file mode 100644 index 00000000..55e9317e --- /dev/null +++ b/core/testdata/format/typeAliases.md @@ -0,0 +1,63 @@ +[test](test/index) / [A](test/-a/index) + +# A + +`class A`[test](test/index) / [B](test/-b/index) + +# B + +`class B`[test](test/index) / [C](test/-c/index) + +# C + +`class C<T>`[test](test/index) / [D](test/-d) + +# D + +`typealias D = `[`A`](test/-a/index)[test](test/index) / [E](test/-e) + +# E + +`typealias E = `[`D`](test/-d)[test](test/index) / [F](test/-f) + +# F + +`typealias F = (`[`A`](test/-a/index)`) -> `[`B`](test/-b/index)[test](test/index) / [G](test/-g) + +# G + +`typealias G = `[`C`](test/-c/index)`<`[`A`](test/-a/index)`>`[test](test/index) / [H](test/-h) + +# H + +`typealias H<T> = `[`C`](test/-c/index)`<T>`[test](test/index) / [I](test/-i) + +# I + +`typealias I<T> = `[`H`](test/-h)`<T>`[test](test/index) / [J](test/-j) + +# J + +`typealias J = `[`H`](test/-h)`<`[`A`](test/-a/index)`>`[test](test/index) / [K](test/-k) + +# K + +`typealias K = `[`H`](test/-h)`<`[`J`](test/-j)`>`[test](test/index) / [L](test/-l) + +# L + +`typealias L = (`[`K`](test/-k)`, `[`B`](test/-b/index)`) -> `[`J`](test/-j)[test](test/index) / [M](test/-m) + +# M + +`typealias M = `[`A`](test/-a/index) + +Documented + +[test](test/index) / [N](test/-n) + +# N + +`typealias ~~N~~ = `[`A`](test/-a/index) +**Deprecated:** !!! + diff --git a/core/testdata/format/typeAliases.package.md b/core/testdata/format/typeAliases.package.md new file mode 100644 index 00000000..0eff1ed5 --- /dev/null +++ b/core/testdata/format/typeAliases.package.md @@ -0,0 +1,24 @@ +[test](test/index) + +## Package <root> + +### Types + +| [A](test/-a/index) | `class A` | +| [B](test/-b/index) | `class B` | +| [C](test/-c/index) | `class C<T>` | + +### Type Aliases + +| [D](test/-d) | `typealias D = `[`A`](test/-a/index) | +| [E](test/-e) | `typealias E = `[`D`](test/-d) | +| [F](test/-f) | `typealias F = (`[`A`](test/-a/index)`) -> `[`B`](test/-b/index) | +| [G](test/-g) | `typealias G = `[`C`](test/-c/index)`<`[`A`](test/-a/index)`>` | +| [H](test/-h) | `typealias H<T> = `[`C`](test/-c/index)`<T>` | +| [I](test/-i) | `typealias I<T> = `[`H`](test/-h)`<T>` | +| [J](test/-j) | `typealias J = `[`H`](test/-h)`<`[`A`](test/-a/index)`>` | +| [K](test/-k) | `typealias K = `[`H`](test/-h)`<`[`J`](test/-j)`>` | +| [L](test/-l) | `typealias L = (`[`K`](test/-k)`, `[`B`](test/-b/index)`) -> `[`J`](test/-j) | +| [M](test/-m) | `typealias M = `[`A`](test/-a/index)<br>Documented | +| [N](test/-n) | `typealias ~~N~~ = `[`A`](test/-a/index) | + diff --git a/core/testdata/javadoc/typealiases.kt b/core/testdata/javadoc/typealiases.kt new file mode 100644 index 00000000..bb09bfad --- /dev/null +++ b/core/testdata/javadoc/typealiases.kt @@ -0,0 +1,11 @@ +class A + +typealias B = A + +class C : B + +typealias D = (A) -> C + +fun some(d: D) { + +}
\ No newline at end of file diff --git a/core/testdata/typealias/asTypeBoundWithVariance.kt b/core/testdata/typealias/asTypeBoundWithVariance.kt new file mode 100644 index 00000000..1aef84d6 --- /dev/null +++ b/core/testdata/typealias/asTypeBoundWithVariance.kt @@ -0,0 +1,7 @@ +package _typealias.astypebound +class A + +typealias B = A + +class C<out T : B> +class D<in T : B>
\ No newline at end of file diff --git a/core/testdata/typealias/chain.kt b/core/testdata/typealias/chain.kt new file mode 100644 index 00000000..520be553 --- /dev/null +++ b/core/testdata/typealias/chain.kt @@ -0,0 +1,8 @@ +package _typealias.chain + +class A + +typealias B = A + +typealias C = B + diff --git a/core/testdata/typealias/deprecated.kt b/core/testdata/typealias/deprecated.kt new file mode 100644 index 00000000..b53d3a20 --- /dev/null +++ b/core/testdata/typealias/deprecated.kt @@ -0,0 +1,7 @@ +package _typealias.deprecated + +class Lol + +@Deprecated("Not mainstream now") +typealias Kek = Lol + diff --git a/core/testdata/typealias/documented.kt b/core/testdata/typealias/documented.kt new file mode 100644 index 00000000..3ca110e5 --- /dev/null +++ b/core/testdata/typealias/documented.kt @@ -0,0 +1,9 @@ +package _typealias.documented + +class A + +/** + * Just typealias + */ +typealias B = A + diff --git a/core/testdata/typealias/functional.kt b/core/testdata/typealias/functional.kt new file mode 100644 index 00000000..dadafa5e --- /dev/null +++ b/core/testdata/typealias/functional.kt @@ -0,0 +1,10 @@ +package _typealias.functional + +class A +class B + +typealias Spell = (A) -> B + +fun magic(spell: Spell) { + +}
\ No newline at end of file diff --git a/core/testdata/typealias/generic.kt b/core/testdata/typealias/generic.kt new file mode 100644 index 00000000..43bc0e23 --- /dev/null +++ b/core/testdata/typealias/generic.kt @@ -0,0 +1,7 @@ +package _typealias.generic + +interface A<T> + +typealias B = A<Any> + +typealias C<T> = A<T>
\ No newline at end of file diff --git a/core/testdata/typealias/inheritanceFromTypeAlias.kt b/core/testdata/typealias/inheritanceFromTypeAlias.kt new file mode 100644 index 00000000..f929ecd0 --- /dev/null +++ b/core/testdata/typealias/inheritanceFromTypeAlias.kt @@ -0,0 +1,7 @@ +package _typealias.inheritance + +open class Some + +typealias Same = Some + +class My : Same
\ No newline at end of file diff --git a/core/testdata/typealias/simple.kt b/core/testdata/typealias/simple.kt new file mode 100644 index 00000000..d688a84d --- /dev/null +++ b/core/testdata/typealias/simple.kt @@ -0,0 +1,5 @@ +package _typealias.simple + +class A + +typealias B = A
\ No newline at end of file |