do not combine receiverInfo with error selectorInfo
This commit is contained in:
Svetlana Isakova
2013-06-04 18:08:13 +04:00
parent ecec6acde8
commit 2337f4b948
2 changed files with 17 additions and 1 deletions
@@ -133,6 +133,9 @@ public class DataFlowValueFactory {
@NotNull
private static IdentifierInfo combineInfo(@Nullable IdentifierInfo receiverInfo, @NotNull IdentifierInfo selectorInfo) {
if (selectorInfo.id == null) {
return ERROR_IDENTIFIER_INFO;
}
if (receiverInfo == null || receiverInfo == ERROR_IDENTIFIER_INFO || receiverInfo.isNamespace) {
return selectorInfo;
}
@@ -182,7 +185,7 @@ public class DataFlowValueFactory {
DeclarationDescriptor declarationDescriptor = bindingContext.get(REFERENCE_TARGET, simpleNameExpression);
if (declarationDescriptor instanceof VariableDescriptor) {
ResolvedCall<?> resolvedCall = bindingContext.get(RESOLVED_CALL, simpleNameExpression);
// todo return assert
// todo uncomment assert
// for now it fails for resolving 'invoke' convention, return it after 'invoke' algorithm changes
// assert resolvedCall != null : "Cannot create right identifier info if the resolved call is not known yet for " + declarationDescriptor;
@@ -0,0 +1,13 @@
package foo
fun dispatch(request: Request) {
val <!UNUSED_VARIABLE!>url<!> = request.getRequestURI() as String
if (request.getMethod()?.length != 0) {
}
}
trait Request {
fun getRequestURI(): String?
fun getMethod(): String?
}