-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(many) Support string concatenation in compiled mode #470
(many) Support string concatenation in compiled mode #470
Conversation
c117b73
to
32cdf9f
Compare
@@ -79,6 +79,7 @@ ClrType switch | |||
|
|||
// Cannot use typeof(AsciiString) since Perlang.Common cannot depend on Perlang.Stdlib | |||
var t when t.FullName == "Perlang.Lang.AsciiString" => true, | |||
var t when t.FullName == "Perlang.Lang.Utf8String" => true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was necessary for one of the tests to pass, and should be added here anyway.
if (expr.TypeReference.ClrType != expr.Right.TypeReference.ClrType && !( | ||
expr.TypeReference.ClrType == typeof(Lang.String) || | ||
expr.TypeReference.ClrType == typeof(Lang.AsciiString) || | ||
expr.TypeReference.ClrType == typeof(Lang.Utf8String))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were added here to avoid peculiar constructs like *s1 + *(perlang::String)perlang::ASCIIString::from_static_string(" ")) + *s2
in the generated code. The problem is that while this would be kind-of-valid in C# and Java, we can't really cast to a perlang::String
like this because this triggers an instantiation => perlang::String
is abstract and cannot (and should not!) ever be instantiated. Ignoring the cast for now is the simplest approach here; let's see if all the tests are still passing or if this breaks something else now...
output.Should() | ||
.Be("Årets varmaste temperatur (Celsius): 32"); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests were added while working on this, but they are not yet operational because the underlying (C++) stdlib code isn't there yet. Will be fixed in an upcoming PR.
32cdf9f
to
861d88b
Compare
861d88b
to
d920924
Compare
d920924
to
685d1b6
Compare
Because we now have an idea around how to allocate Perlang strings dynamically (#453), we can also implement the
+
operator now which fixes one of the remaining "not supported in compiled mode" features.