Skip to content

Commit 7333b41

Browse files
author
Ed Seidewitz
committed
Issue #15 - Set type of effective LHS of local name declaration stmt.
- This ensures that all required conversions are properly mapped.
1 parent f5bade1 commit 7333b41

File tree

6 files changed

+83615
-83389
lines changed

6 files changed

+83615
-83389
lines changed

org.modeldriven.alf.eclipse/UML/_RunTests.uml

Lines changed: 83601 additions & 83386 deletions
Large diffs are not rendered by default.
29 Bytes
Binary file not shown.
29 Bytes
Binary file not shown.

org.modeldriven.alf/src/org/modeldriven/alf/execution/AlfBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
public abstract class AlfBase {
2626

27-
public static final String ALF_VERSION = "1.0.0";
27+
public static final String ALF_VERSION = "1.0.0a/maint-01";
2828

2929
protected boolean isVerbose = false;
3030

org.modeldriven.alf/src/org/modeldriven/alf/syntax/statements/impl/LocalNameDeclarationStatementImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ public AssignmentExpression getAssignmentExpression() {
247247

248248
NameLeftHandSide lhs = new NameLeftHandSide();
249249
lhs.setTarget(target);
250+
lhs.setType(self.getType());
250251

251252
AssignmentExpression assignmentExpression = new AssignmentExpression();
252253
assignmentExpression.setOperator("=");

org.modeldriven.alf/tests-x/Expressions_Sequence_Construction.alf

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Expressions_Sequence_Construction specializes Test {
1010
@Create public run(in tester: Tester[0..1]) {
1111
super(tester);
1212

13-
this.test(seq1,seq2,seq3,seq4,seq5,seq6,seq7,x,customers,set1,set2,list);
13+
this.test(seq1,seq2,seq3,seq4,seq5,seq6,seq7,x,customers,set1,set2,list,conv1,conv2);
1414

1515
AssertList("seq1", seq1, any[]{"apple","orange","strawberry"});
1616
AssertList("seq2", seq2, any[]{"apple","orange","strawberry"});
@@ -35,6 +35,9 @@ class Expressions_Sequence_Construction specializes Test {
3535
AssertEqual("list.size()", list.size(), 2);
3636
AssertList("list.at(1)", list.at(1).toSequence(), any[]{"apple","orange"});
3737
AssertList("list.at(2)", list.at(2).toSequence(), any[]{"strawberry","raspberry"});
38+
39+
AssertEqual("conv1->size()", conv1->size(), 3);
40+
AssertEqual("conv2->size()", conv2->size(), 3);
3841

3942
this.done();
4043
}
@@ -61,7 +64,9 @@ class Expressions_Sequence_Construction specializes Test {
6164
out customers: Customer[] sequence,
6265
out set1: Set<Integer>,
6366
out set2: Set<Integer>,
64-
out list: List< List<String> >
67+
out list: List< List<String> >,
68+
out conv1: Integer[],
69+
out conv2: Integer[]
6570
) {
6671

6772
seq1 = String[]{"apple","orange","strawberry"};
@@ -81,5 +86,10 @@ class Expressions_Sequence_Construction specializes Test {
8186
set1 = new Set<Integer>(Integer[]{1,3,45});
8287
set2 = Set<Integer>{1, 3, 45};
8388
list = new List< List<String> >{{"apple","orange"},{"strawberry","raspberry"}};
89+
90+
// Collection conversion
91+
conv1 = set2;
92+
let seq_set2: Integer[] = set2;
93+
conv2 = seq_set2;
8494
}
8595
}

0 commit comments

Comments
 (0)