From 04a6a1d4a44eecaeab38fa4c18bcbb2844f1d895 Mon Sep 17 00:00:00 2001 From: Svetlana Isakova Date: Fri, 8 Feb 2013 16:10:30 +0400 Subject: [PATCH] make TRACE_STUB throw exceptions instead of silently being used --- .../calls/context/TypeInfoForCall.java | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/TypeInfoForCall.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/TypeInfoForCall.java index 6bf67a314d2..f624b8347f1 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/TypeInfoForCall.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/TypeInfoForCall.java @@ -19,7 +19,9 @@ package org.jetbrains.jet.lang.resolve.calls.context; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.lang.descriptors.FunctionDescriptor; +import org.jetbrains.jet.lang.diagnostics.Diagnostic; import org.jetbrains.jet.lang.psi.Call; +import org.jetbrains.jet.lang.resolve.BindingContext; import org.jetbrains.jet.lang.resolve.BindingTrace; import org.jetbrains.jet.lang.resolve.BindingTraceContext; import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo; @@ -29,10 +31,47 @@ import org.jetbrains.jet.lang.resolve.calls.tasks.TracingStrategy; import org.jetbrains.jet.lang.types.JetType; import org.jetbrains.jet.lang.types.JetTypeInfo; import org.jetbrains.jet.lang.types.TypeUtils; +import org.jetbrains.jet.util.slicedmap.ReadOnlySlice; +import org.jetbrains.jet.util.slicedmap.WritableSlice; + +import java.util.Collection; public class TypeInfoForCall { - private final static BindingTrace TRACE_STUB = new BindingTraceContext(); + private final static BindingTrace TRACE_STUB = new BindingTrace() { + + @Override + public BindingContext getBindingContext() { + throw new UnsupportedOperationException(); + } + + @Override + public void record(WritableSlice slice, K key, V value) { + throw new UnsupportedOperationException(); + } + + @Override + public void record(WritableSlice slice, K key) { + throw new UnsupportedOperationException(); + } + + @Nullable + @Override + public V get(ReadOnlySlice slice, K key) { + throw new UnsupportedOperationException(); + } + + @NotNull + @Override + public Collection getKeys(WritableSlice slice) { + throw new UnsupportedOperationException(); + } + + @Override + public void report(@NotNull Diagnostic diagnostic) { + throw new UnsupportedOperationException(); + } + }; private final JetTypeInfo typeInfo;