Disallow the redefinition of built-in functions.
While working on overload handling, I inadvertently discovered that we
silently allowed overloads of built-in functions in user code. We were
trying to detect duplicate function definitions, but there were two
problems:
- Intrinsics don't actually provide a body, so they are more like
prototypes. Defining a prototyped function later isn't usually bad.
- Intrinsics use $genTypes, and our duplicate-function detection code
did not consider generics at all.
Now, the duplicate-function detection code is smart enough to sort out
generics, and overloading built-in functions is forbidden whether or
not the built-in function has a body.
Change-Id: Ia6221d5f74e195299eafd491ff659c52801bad2b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/564999
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
9 files changed