File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -524,21 +524,18 @@ void BindingSet::addBinding(PotentialBinding binding) {
524
524
llvm::any_of (Bindings, [](const PotentialBinding &binding) {
525
525
return binding.BindingType ->isDoubleType ();
526
526
}))
527
- return ;
527
+ return false ;
528
528
529
529
if (type->isDoubleType ()) {
530
530
auto inferredCGFloat =
531
531
llvm::find_if (Bindings, [](const PotentialBinding &binding) {
532
532
return binding.BindingType ->isCGFloatType ();
533
533
});
534
534
535
- // TODO: If CGFloat has been already inferred, we can't simply remove it
536
- // because that would break supertype join logic - index stored in
537
- // `lastSupertypeIndex` would get invalidated. Instead let's replace type
538
- // of an existing binding with Double.
539
535
if (inferredCGFloat != Bindings.end ()) {
540
- inferredCGFloat->BindingType = type;
541
- return ;
536
+ Bindings.erase (inferredCGFloat);
537
+ Bindings.insert (inferredCGFloat->withType (type));
538
+ return false ;
542
539
}
543
540
}
544
541
}
You can’t perform that action at this time.
0 commit comments