Skip to content
Draft
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c71098e
Self types: implementation of Self types using `@Self` as annotation.
maxim092001 Apr 16, 2022
3c4ce65
Self types: Add Self type for class annotated with @Self into all
maxim092001 Nov 19, 2022
8f4d527
Self types: rewritten implementation of ControlFlowInfo from Kotlin
maxim092001 Dec 10, 2022
210d584
rebase and fix conflicts
maxim092001 Jan 7, 2023
1391397
Self types: Add enum class checker.
maxim092001 Jan 11, 2023
9cdec30
Self types: Fix double <Self> in super type parameters
maxim092001 Jan 11, 2023
ec1ca0f
Self types: diagnostics for annotation classes
maxim092001 Jan 14, 2023
d2848c5
Self types: multiple tests added.
maxim092001 Jan 16, 2023
7942529
Self types: add test for object, refactor diagnostic tests
maxim092001 Jan 20, 2023
0cd7520
Self types: refactor box tests structure.
maxim092001 Jan 22, 2023
6ad8c6c
Self types: fix annotation find inside FirTypeResolverImpl
maxim092001 Jan 27, 2023
07fd7cc
Self types: refactor cfg tests
maxim092001 Jan 27, 2023
7780e18
Self types: add self type parameter only for FirRegularClass
maxim092001 Jan 27, 2023
8649129
Self types: test with self class as return type with implicit self ty…
maxim092001 Jan 27, 2023
279889b
Self types: test with self class as return type with implicit self ty…
maxim092001 Jan 27, 2023
42b129f
Self types: test with self abstract class and manual self type parameter
maxim092001 Jan 27, 2023
0a26bb4
Self types: more tests for nested classes
maxim092001 Jan 27, 2023
a17bc3e
Self types: add transformation chain test
maxim092001 Feb 1, 2023
896f2ad
Self types: add observer pattern test
maxim092001 Feb 11, 2023
4eb4edc
Self types: use this without explicit cast to Self
maxim092001 Mar 5, 2023
6c03792
Self types: remove unchecked cast check for Self types
maxim092001 Mar 5, 2023
c8abb59
Self types: add outer and nested self classes
maxim092001 Mar 16, 2023
8eea494
Self types: fix fir
maxim092001 Mar 16, 2023
3ab3b57
Self types: change symbol name check to standard name in SelfTypeChecker
maxim092001 Mar 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ open class FirSupertypeResolverVisitor(
private fun addSelfToTypeParameters(firClass: FirClassLikeDeclaration, session: FirSession) {
val isSelf = firClass.getAnnotationByClassId(StandardClassIds.Annotations.Self, session) != null
val params = firClass.typeParameters
if (params is MutableList && isSelf) {
if (params is MutableList && isSelf && params.find { it.symbol.name == SpecialNames.SELF_TYPE } == null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test confirming this check is needed

val selfSymbol = FirTypeParameterSymbol()
val firTypeParameterBuilder = FirTypeParameterBuilder()
firTypeParameterBuilder.bounds.add(buildResolvedTypeRef {
Expand Down