In the latest version of the ArcGIS API for JavaScript (4.12), the QueryTask function doesn't seem to be working as expected anymore.
I am getting the following error:

I discovered that if I create a new instance of a Query, it works, but when trying to autocast using a simple object for the query, it doesn't work.
Here is a simple example that demonstrates the problem that I am seeing:
JS Bin example
Notes: that when you switch the script reference back to 4.11 from 4.12, the QueryTask works as expected.
I would prefer to use autocasting for my queries going forward. Please let me know if I am doing something wrong.