From 011019a20eec1de2bdc699ca81e5465db8d543a9 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 1 Apr 2016 14:00:29 +0200 Subject: KT-11530: when the receiver type of an extension is generic, use subclass instead of subtype check to determine applicability (subtype check doesn't work because type parameter of receiver type is unrelated to type parameter of base class) --- core/testdata/format/genericInheritedExtensions.kt | 11 +++++++++++ core/testdata/format/genericInheritedExtensions.md | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 core/testdata/format/genericInheritedExtensions.kt create mode 100644 core/testdata/format/genericInheritedExtensions.md (limited to 'core/testdata') diff --git a/core/testdata/format/genericInheritedExtensions.kt b/core/testdata/format/genericInheritedExtensions.kt new file mode 100644 index 00000000..4c07e1e5 --- /dev/null +++ b/core/testdata/format/genericInheritedExtensions.kt @@ -0,0 +1,11 @@ +open class Foo + +class Bar : Foo() + +fun Foo.first() { + +} + +fun Bar.second() { + +} diff --git a/core/testdata/format/genericInheritedExtensions.md b/core/testdata/format/genericInheritedExtensions.md new file mode 100644 index 00000000..e02683a9 --- /dev/null +++ b/core/testdata/format/genericInheritedExtensions.md @@ -0,0 +1,21 @@ +[test](test/index) / [Bar](test/-bar/index) + + +# Bar + +`class Bar<T> : [Foo](test/-foo/index)<T>` + + + +### Constructors + + +| [<init>](test/-bar/-init-) | `Bar()` | + + +### Extension Functions + + +| [first](test/first) | `fun <T> [Foo](test/-foo/index)<T>.first(): Unit` | +| [second](test/second) | `fun <T> [Bar](test/-bar/index)<T>.second(): Unit` | + -- cgit