31 if (
args.size() != 1) {
33 "' constructor, (expected exactly 1 argument, but found " +
38 const Type& argType =
args[0]->type();
42 const char* swizzleHint =
"";
45 swizzleHint =
"; use '.x' instead";
47 swizzleHint =
"; use '[0][0]' instead";
52 "'" + argType.
displayName() +
"' is not a valid parameter to '" +
66 std::unique_ptr<Expression> arg) {
72 if (arg->type().matches(
type)) {
73 arg->setPosition(
pos);
105 return std::make_unique<ConstructorScalarCast>(
pos,
type, std::move(arg));
static std::unique_ptr< Expression > MakeConstantValueForVariable(Position pos, std::unique_ptr< Expression > expr)
static std::unique_ptr< Expression > Convert(const Context &context, Position pos, const Type &rawType, ExpressionArray args)
static std::unique_ptr< Expression > Make(const Context &context, Position pos, const Type &type, std::unique_ptr< Expression > arg)
void error(Position position, std::string_view msg)
const Type & type() const
static std::unique_ptr< Literal > Make(Position pos, double value, const Type *type)
std::unique_ptr< Expression > & argument()
virtual bool isVector() const
bool isAllowedInES2(const Context &context) const
virtual const Type & componentType() const
bool matches(const Type &other) const
virtual bool isMatrix() const
virtual bool isLiteral() const
virtual bool isScalar() const
virtual const Type & scalarTypeForLiteral() const
bool checkForOutOfRangeLiteral(const Context &context, const Expression &expr) const
std::string displayName() const
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
static SkString to_string(int n)