When i use the DQL operator "new" to build data transfert object with string literal expression as field in object constructor, the call to Query::getResult thrown an exception.
The string literal expression must be the first parameter of the constructor.
Following DQL :
Thrown exception :
ContextErrorException: Notice: Undefined variable: fieldType in doctrine/orm/lib/Doctrine/ORM/Query/SqlWalker.php line 1527
That happens because in SqlWalker::walkNewObject on the AST\Literal switch case. There is no case for AST\Literal::STRING, so $fieldType isn't defined.
I have also noted if the scalar string isn't the first parameter, $fieldType take the type of previous foreach element.