2136 public void substBounds(List<Type> from, List<Type> to, Types types) { |
2136 public void substBounds(List<Type> from, List<Type> to, Types types) { |
2137 final ListBuffer<Pair<InferenceBound, Type>> boundsChanged = new ListBuffer<>(); |
2137 final ListBuffer<Pair<InferenceBound, Type>> boundsChanged = new ListBuffer<>(); |
2138 UndetVarListener prevListener = listener; |
2138 UndetVarListener prevListener = listener; |
2139 try { |
2139 try { |
2140 //setup new listener for keeping track of changed bounds |
2140 //setup new listener for keeping track of changed bounds |
2141 listener = new UndetVarListener() { |
2141 listener = (uv, ib, t, _ignored) -> { |
2142 public void varBoundChanged(UndetVar uv, InferenceBound ib, Type t, boolean _ignored) { |
2142 Assert.check(uv == UndetVar.this); |
2143 Assert.check(uv == UndetVar.this); |
2143 boundsChanged.add(new Pair<>(ib, t)); |
2144 boundsChanged.add(new Pair<>(ib, t)); |
|
2145 } |
|
2146 }; |
2144 }; |
2147 for (Map.Entry<InferenceBound, List<Type>> _entry : bounds.entrySet()) { |
2145 for (Map.Entry<InferenceBound, List<Type>> _entry : bounds.entrySet()) { |
2148 InferenceBound ib = _entry.getKey(); |
2146 InferenceBound ib = _entry.getKey(); |
2149 List<Type> prevBounds = _entry.getValue(); |
2147 List<Type> prevBounds = _entry.getValue(); |
2150 ListBuffer<Type> newBounds = new ListBuffer<>(); |
2148 ListBuffer<Type> newBounds = new ListBuffer<>(); |