Avoid returning a DSLExpression with an invalid type.

We shouldn't return expressions that violate basic invariants (such as a
Constructor with an invalid Type) because future code should be able to
rely on those invariants to hold. Returning a Constructor with an
invalid Type broke some assertions I had added; these assertions checked
that the Constructor's type was valid before operating on it.

Change-Id: I861927ad042f30d4a1e20896149ce404f4160ffb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455657
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
3 files changed