swift
c43cb6ac - [ast] Add wrapInOptionalType to CanType and TypeBase.

Commit
3 years ago
[ast] Add wrapInOptionalType to CanType and TypeBase. This API just wraps the current type T into an Optional<T> and returns the Optional<T> type. We use this all the time in the optimizer and I found I needed it in SILGen as well but at the AST level, hence the addition. In the next commit, I change the API in SILType that does this to use this helper instead. I am doing that to make it easier to cherry-pick this with a subsequent change I am making to fix a bug.
Author
Committer
Parents
  • include/swift/AST
    • File
      Type.h
    • File
      Types.h
  • lib/AST
    • File
      Type.cpp