mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Re-sugar the types we deduce for type variables.
This makes us deduce types like "[Int]" and "[String : Int]" from array/dictionary literals, giving a nicer REPL experience. Swift SVN r19258
This commit is contained in:
@@ -666,6 +666,12 @@ Type ConstraintSystem::openBindingType(Type type, DeclContext *dc) {
|
||||
}
|
||||
}
|
||||
|
||||
if (auto dict = isDictionaryType(type)) {
|
||||
if (auto replacement = getTypeChecker().getDictionaryType(
|
||||
SourceLoc(), dict->first, dict->second))
|
||||
return replacement;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user