diff options
author | Michi Henning <michi@zeroc.com> | 2004-10-27 06:01:50 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2004-10-27 06:01:50 +0000 |
commit | 4352b1e8faa101e131623511b5f46738dbaeb27a (patch) | |
tree | ad0e3c47ea5956e9989d13bc68c539d6cf37f822 /cpp/src/slice2vb/Gen.cpp | |
parent | Fixed bug in code generator: dictionaries with value types that were (diff) | |
download | ice-4352b1e8faa101e131623511b5f46738dbaeb27a.tar.bz2 ice-4352b1e8faa101e131623511b5f46738dbaeb27a.tar.xz ice-4352b1e8faa101e131623511b5f46738dbaeb27a.zip |
Fixes to code generation for nested sequences.
Diffstat (limited to 'cpp/src/slice2vb/Gen.cpp')
-rwxr-xr-x | cpp/src/slice2vb/Gen.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cpp/src/slice2vb/Gen.cpp b/cpp/src/slice2vb/Gen.cpp index 2464b7b20d3..f3df8044636 100755 --- a/cpp/src/slice2vb/Gen.cpp +++ b/cpp/src/slice2vb/Gen.cpp @@ -1452,7 +1452,7 @@ Slice::Gen::TypesVisitor::visitSequence(const SequencePtr& p) _out << sp << nl << "Public Function ToArray() As " << s << "()"; _out.inc(); - _out << nl << "Dim __a() As " << s << " = New " << s << "(InnerList.Count - 1) {}"; + _out << nl << "Dim __a As " << s << "() = New " << toArrayAlloc(s + "()", "InnerList.Count - 1") << " {}"; _out << nl << "InnerList.CopyTo(__a)"; _out << nl << "Return __a"; _out.dec(); @@ -2594,14 +2594,14 @@ Slice::Gen::TypesVisitor::visitDictionary(const DictionaryPtr& p) _out.dec(); _out << nl << "Next"; SequencePtr seq = SequencePtr::dynamicCast(p->valueType()); - bool valueIsArray = seq && !seq->hasMetaData("cs:collection"); + bool valueIsArray = seq && !seq->hasMetaData("vb:collection"); if(valueIsArray) { _out << nl << "Dim __vlhs As " << vs << "() = New " << toArrayAlloc(vs + "()", "Count - 1") << " {}"; } else { - _out << nl << "Dim __vlhs As " << vs << " = New " << toArrayAlloc(vs, "Count - 1") << " {}"; + _out << nl << "Dim __vlhs As " << vs << "() = New " << vs << "(Count - 1) {}"; } _out << nl << "Values.CopyTo(__vlhs, 0)"; _out << nl << "_System.Array.Sort(__vlhs)"; @@ -2612,7 +2612,7 @@ Slice::Gen::TypesVisitor::visitDictionary(const DictionaryPtr& p) } else { - _out << nl << "Dim __vrhs As " << vs << " = New " << toArrayAlloc(vs, vrhsCount) << " {}"; + _out << nl << "Dim __vrhs As " << vs << "() = New " << vs << '(' << vrhsCount << ") {}"; } _out << nl << "CType(other, " << name << ").Values.CopyTo(__vrhs, 0)"; _out << nl << "_System.Array.Sort(__vrhs)"; @@ -2819,7 +2819,7 @@ Slice::Gen::TypesVisitor::visitDataMember(const DataMemberPtr& p) bool isClass = false; ContainedPtr cont = ContainedPtr::dynamicCast(p->container()); assert(cont); - if(StructPtr::dynamicCast(cont) && cont->hasMetaData("cs:class")) + if(StructPtr::dynamicCast(cont) && cont->hasMetaData("vb:class")) { baseTypes = DotNet::ICloneable; } |