Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
Fix false flag name clash
Browse files Browse the repository at this point in the history
Signed-off-by: Wilko Manger <wilko@dotlin.org>
  • Loading branch information
wilkomanger committed Oct 3, 2022
1 parent 35ff859 commit 56067bb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ fun IrType.isNullableDouble() = isNullableType(IdSignatureValues._double)
fun IrType.isNullableChar() = isNullableType(IdSignatureValues._char)

val IrDeclarationWithVisibility.isPrivate
get() = visibility == DescriptorVisibilities.PRIVATE
get() = visibility == DescriptorVisibilities.PRIVATE || visibility == DescriptorVisibilities.PRIVATE_TO_THIS

inline fun <reified T : IrDeclarationWithName> Iterable<IrDeclaration>.withNameOrNull(name: String): T? =
filterIsInstance<T>().firstOrNull { it.name == Name.identifier(name) }
Expand Down
27 changes: 27 additions & 0 deletions compiler/src/test/kotlin/compile/NameMangling.kt
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,31 @@ class NameMangling : BaseTest {
"""
)
}

@Test
fun `class with lateinit property and method with the same name`() = assertCompile {
kotlin(
"""
class Test<out T> {
private lateinit var next: T
fun next() {}
}
"""
)

dart(
"""
import 'package:meta/meta.dart';
@sealed
class Test<T> {
@nonVirtual
late T _next;
@nonVirtual
void next() {}
}
"""
)
}
}

0 comments on commit 56067bb

Please sign in to comment.