diff options
Diffstat (limited to 'source/slang/slang-check-conversion.cpp')
| -rw-r--r-- | source/slang/slang-check-conversion.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/slang/slang-check-conversion.cpp b/source/slang/slang-check-conversion.cpp index 7cb71a1bd..248c83fe5 100644 --- a/source/slang/slang-check-conversion.cpp +++ b/source/slang/slang-check-conversion.cpp @@ -785,8 +785,8 @@ bool SemanticsVisitor::_coerce( return true; } - // If both are string types we assume they are convertable in both directions - if (as<StringTypeBase>(fromType) && as<StringTypeBase>(toType)) + // Assume string literals are convertible to any string type. + if (as<StringLiteralExpr>(fromExpr) && as<StringTypeBase>(toType)) { if (outToExpr) *outToExpr = fromExpr; |
