@Test public void shouldGetContextFromParent() { when(parentScope.getContext(intType())).thenReturn(ImmutableSet.of(symbol("scotch.data.num.Num"))); assertThat(childScope.getContext(intType()), contains( symbol("scotch.data.num.Num") )); }
@Override public Set<Symbol> getContext(Type type) { return ImmutableSet.<Symbol>builder() .addAll(types.getContext(type)) .addAll(parent.getContext(type)) .build(); }
ChildScope extends BlockScope { @Override public Set<Symbol> getContext(Type type) { return ImmutableSet.<Symbol>builder() .addAll(types.getContext(type)) .addAll(parent.getContext(type)) .build(); } }
ChildScope extends BlockScope { @Override public Set<Symbol> getContext(Type type) { return ImmutableSet.<Symbol>builder() .addAll(types.getContext(type)) .addAll(parent.getContext(type)) .build(); } ChildScope(Scope parent, TypeScope types, SymbolResolver resolver, SymbolGenerator symbolGenerator, String moduleName); }
ChildScope extends BlockScope { @Override public Set<Symbol> getContext(Type type) { return ImmutableSet.<Symbol>builder() .addAll(types.getContext(type)) .addAll(parent.getContext(type)) .build(); } ChildScope(Scope parent, TypeScope types, SymbolResolver resolver, SymbolGenerator symbolGenerator, String moduleName); @Override void addLocal(String argument); @Override void capture(String argument); @Override Scope enterScope(); @Override List<String> getCaptures(); @Override Set<Symbol> getContext(Type type); @Override List<String> getLocals(); @Override Optional<TypeClassDescriptor> getMemberOf(ValueReference valueRef); @Override Optional<Operator> getOperator(Symbol symbol); @Override Optional<Type> getRawValue(Symbol symbol); @Override void insertChild(Scope newChild); @Override boolean isDefined(Symbol symbol); @Override void prependLocals(List<String> locals); @Override Optional<Symbol> qualify(Symbol symbol); @Override void setParent(Scope newParent); }
ChildScope extends BlockScope { @Override public Set<Symbol> getContext(Type type) { return ImmutableSet.<Symbol>builder() .addAll(types.getContext(type)) .addAll(parent.getContext(type)) .build(); } ChildScope(Scope parent, TypeScope types, SymbolResolver resolver, SymbolGenerator symbolGenerator, String moduleName); @Override void addLocal(String argument); @Override void capture(String argument); @Override Scope enterScope(); @Override List<String> getCaptures(); @Override Set<Symbol> getContext(Type type); @Override List<String> getLocals(); @Override Optional<TypeClassDescriptor> getMemberOf(ValueReference valueRef); @Override Optional<Operator> getOperator(Symbol symbol); @Override Optional<Type> getRawValue(Symbol symbol); @Override void insertChild(Scope newChild); @Override boolean isDefined(Symbol symbol); @Override void prependLocals(List<String> locals); @Override Optional<Symbol> qualify(Symbol symbol); @Override void setParent(Scope newParent);  }