Implicit receiver smart casts implementation and highlighting
This commit is contained in:
+5
@@ -74,6 +74,11 @@ class VariablesHighlightingVisitor extends AfterAnalysisHighlightingVisitor {
|
||||
holder.createInfoAnnotation(expression, "Smart cast to " + DescriptorRenderer.FQ_NAMES_IN_TYPES.renderType(smartCast)).setTextAttributes(
|
||||
KotlinHighlightingColors.SMART_CAST_VALUE);
|
||||
}
|
||||
smartCast = bindingContext.get(IMPLICIT_RECEIVER_SMARTCAST, expression);
|
||||
if (smartCast != null) {
|
||||
holder.createInfoAnnotation(expression, "Implicit receiver smart cast to " + DescriptorRenderer.FQ_NAMES_IN_TYPES.renderType(smartCast)).setTextAttributes(
|
||||
KotlinHighlightingColors.SMART_CAST_VALUE);
|
||||
}
|
||||
super.visitExpression(expression);
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -1,5 +1,9 @@
|
||||
<info descr="null">open</info> class A() {
|
||||
fun foo() {}
|
||||
fun foo() {
|
||||
if (this is B) {
|
||||
<info descr="Implicit receiver smart cast to B">bar</info>()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class B() : A() {
|
||||
|
||||
Reference in New Issue
Block a user