-
Notifications
You must be signed in to change notification settings - Fork 755
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
Restrict annotation value to true, map<anydata|readonly> , map<anydata|readonly>[] #23473
Restrict annotation value to true, map<anydata|readonly> , map<anydata|readonly>[] #23473
Conversation
59a927a
to
5ed037f
Compare
c63bb6c
to
5a22d1c
Compare
6cba4c0
to
940baac
Compare
0491081
to
c3904f5
Compare
8d15074
to
3172e25
Compare
22b0b95
to
f0b55bc
Compare
750b4a6
to
426ca09
Compare
stdlib/messaging/rabbitmq/src/main/ballerina/src/rabbitmq/rabbitmq_commons.bal
Show resolved
Hide resolved
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.
RabbitMQ changes LGTM.
return types.isAssignable(type, symTable.trueType); | ||
} | ||
|
||
private boolean isAnyDataOrReadOnlyTypeSkippingObjectType(BType type) { |
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.
Shall we create an issue to track fixing std lib deviations and add back the object validation to annotations?
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.
Issue #24217
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.
Created an issue to do language changes after StandardLib changes: #24246
...erina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SymbolEnter.java
Outdated
Show resolved
Hide resolved
Closed and re-opened because the github workflow has been updated. |
0d31fb6
to
16a41d8
Compare
d3941fa
to
41858ae
Compare
Annotation value is restricted to true, map<anydata|readonly> or map<anydata|readonly>[] value. Changes will also make sure that annotation value is a read only clone of the given value. Therefore user cannot change annotation value via annotation access.
Uniformity for `readonly & T` and `T & readonly`. Chose `readonly & T`. Refactor java code logic. Instead of making fields readonly for implementations of abstract objects, whole object is made readonly.
3751e75
to
5342dcd
Compare
@@ -107,6 +107,11 @@ public Object copy(Map<Object, Object> refs) { | |||
return this; | |||
} | |||
|
|||
@Override | |||
public void freezeDirect() { |
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.
Please create an issue to track verifying these changes with @irshadnilam's changes.
} | ||
|
||
@Test(expectedExceptions = BLangRuntimeException.class, | ||
expectedExceptionsMessageRegExp = "^error: \\{.*\\}InvalidUpdate message=Invalid update " + |
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.
Please create an issue for this too?
resultAccessNegative = BCompileUtil.compile("test-src/annotations/annotation_access_negative" + | ||
".bal"); |
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.
Can go on one line.
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.
Can we add an annotation test where the annotation fields are the newly allowed readonly types?
A simple test for an annotation with object, service, function, handle, and typedesc fields.
Created an issue to incorporated all feedbacks related to unit test cases. |
Purpose
Fixes #15533
Approach
Samples
Remarks
Check List