-
Notifications
You must be signed in to change notification settings - Fork 7
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
compilation errors on simple session #770
Comments
Thanks for the report. There are several issues:
type Only_Payload is
message
P : Opaque with Size => Message'Last;
end message;
The missing detection of
The issue will be obsolete after realizing #736, as
diff --git a/server.rflx b/server.rflx
index 7fcb473..6cf8dc7 100644
--- a/server.rflx
+++ b/server.rflx
@@ -1,9 +1,13 @@
with Chat;
package Server is
- type Only_Payload is
+ type Payload_Size is mod 2**16;
+
+ type Only_Payload (Size : Payload_Size) is
message
- P : Opaque with Size => Message'Last;
+ P : Opaque
+ with Size => Size
+ if Size mod 8 = 0;
end message;
generic
@@ -19,7 +23,7 @@ package Server is
state First is
begin
Channel'Read (Msg);
- Outgoing := Only_Payload'(P => Msg.Payload);
+ Outgoing := Only_Payload'(Size => Msg'Size, P => Msg.Payload);
Output'Write(Outgoing);
transition
then Last But the code generated for the parameterized message is invalid: type Only_Payload (Size : Payload_Size) is
message
null
then P
if Size mod 8 = 0;
P : Opaque with Size => Size;
end message;
Will be fixed in #771.
diff --git a/server.rflx b/server.rflx
index 7fcb473..3c24b97 100644
--- a/server.rflx
+++ b/server.rflx
@@ -1,9 +1,14 @@
with Chat;
package Server is
+ type Payload_Size is mod 2**16;
+
type Only_Payload is
message
- P : Opaque with Size => Message'Last;
+ Size : Payload_Size;
+ P : Opaque
+ with Size => Size
+ if Size mod 8 = 0;
end message;
generic
@@ -19,7 +24,7 @@ package Server is
state First is
begin
Channel'Read (Msg);
- Outgoing := Only_Payload'(P => Msg.Payload);
+ Outgoing := Only_Payload'(Size => Msg'Size, P => Msg.Payload);
Output'Write(Outgoing);
transition
then Last But
Will be solved in this issue.
Will be solved in this issue. Unfortunately, I don't see a simple workaround yet. Moving the data of an opaque field from one message to a message of another type seems to be broken (cf. 5; the wrong context type is used, the fix should be rather simple in the code generator). Using the same message type should work, but probably does not really fit to your example. |
@treiher Feels like we should create anther 4-5 issues that address the underlying problems? |
I have added a note to each issue found in my previous comment to indicate in which ticket the particular issue is fixed. |
@kanigsson The issues (3), (4) and (5) are fixed on branch |
Thanks, with your suggested patch (I modified it slightly to use a size in bytes instead of bits) and the changes on |
chat.rflx.txt
server.rflx.txt
Running Recordflux on the attached files results in code that doesn't compile:
As far as I can see, there are two problems:
Is there a workaround?
The text was updated successfully, but these errors were encountered: