covariant and override attributes better name
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7196 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
88f2cdc5bd
commit
7a72389977
3 changed files with 13 additions and 13 deletions
|
|
@ -1542,15 +1542,15 @@ class CSHARP : public Language {
|
|||
/* Get return types */
|
||||
if ((tm = Swig_typemap_lookup_new("cstype",n,"",0))) {
|
||||
// Note that in the case of polymorphic (covariant) return types, the method's return type is changed to be the base of the C++ return type
|
||||
SwigType *virtualtype = Getattr(n,"virtual:type");
|
||||
SwigType *covariant = Getattr(n,"covariant");
|
||||
String *cstypeout = Getattr(n,"tmap:cstype:out"); // the type in the cstype typemap's out attribute overrides the type in the typemap
|
||||
if (cstypeout)
|
||||
tm = cstypeout;
|
||||
substituteClassname(virtualtype ? virtualtype : t, tm);
|
||||
substituteClassname(covariant ? covariant : t, tm);
|
||||
Printf(return_type, "%s", tm);
|
||||
if (virtualtype)
|
||||
if (covariant)
|
||||
Swig_warning(WARN_CSHARP_COVARIANT_RET, input_file, line_number,
|
||||
"Covariant return types not supported in C#. Proxy method will return %s.\n", SwigType_str(virtualtype,0));
|
||||
"Covariant return types not supported in C#. Proxy method will return %s.\n", SwigType_str(covariant,0));
|
||||
} else {
|
||||
Swig_warning(WARN_CSHARP_TYPEMAP_CSWTYPE_UNDEF, input_file, line_number,
|
||||
"No cstype typemap defined for %s\n", SwigType_str(t,0));
|
||||
|
|
@ -1573,7 +1573,7 @@ class CSHARP : public Language {
|
|||
Printf(function_code, " %s ", methodmods);
|
||||
if (static_flag)
|
||||
Printf(function_code, "static ");
|
||||
if (Getattr(n,"virtual:derived"))
|
||||
if (Getattr(n,"override"))
|
||||
Printf(function_code, "override ");
|
||||
else if (checkAttribute(n, "storage", "virtual"))
|
||||
Printf(function_code, "virtual ");
|
||||
|
|
|
|||
|
|
@ -1831,12 +1831,12 @@ class JAVA : public Language {
|
|||
/* Get return types */
|
||||
if ((tm = Swig_typemap_lookup_new("jstype",n,"",0))) {
|
||||
// Note that in the case of polymorphic (covariant) return types, the method's return type is changed to be the base of the C++ return type
|
||||
SwigType *virtualtype = Getattr(n,"virtual:type");
|
||||
substituteClassname(virtualtype ? virtualtype : t, tm);
|
||||
SwigType *covariant = Getattr(n,"covariant");
|
||||
substituteClassname(covariant ? covariant : t, tm);
|
||||
Printf(return_type, "%s", tm);
|
||||
if (virtualtype)
|
||||
if (covariant)
|
||||
Swig_warning(WARN_JAVA_COVARIANT_RET, input_file, line_number,
|
||||
"Covariant return types not supported in Java. Proxy method will return %s.\n", SwigType_str(virtualtype,0));
|
||||
"Covariant return types not supported in Java. Proxy method will return %s.\n", SwigType_str(covariant,0));
|
||||
} else {
|
||||
Swig_warning(WARN_JAVA_TYPEMAP_JSTYPE_UNDEF, input_file, line_number,
|
||||
"No jstype typemap defined for %s\n", SwigType_str(t,0));
|
||||
|
|
@ -3053,8 +3053,8 @@ class JAVA : public Language {
|
|||
|
||||
String *jdesc;
|
||||
|
||||
SwigType *virtualtype = Getattr(n,"virtual:type");
|
||||
SwigType *adjustedreturntype = virtualtype ? virtualtype : returntype;
|
||||
SwigType *covariant = Getattr(n,"covariant");
|
||||
SwigType *adjustedreturntype = covariant ? covariant : returntype;
|
||||
Parm *adjustedreturntypeparm = NewParmFromNode(adjustedreturntype, empty_str, n);
|
||||
|
||||
if ((tm = Swig_typemap_lookup_new("directorin", adjustedreturntypeparm, "", 0)) != NULL
|
||||
|
|
|
|||
|
|
@ -2785,7 +2785,7 @@ MODULA3 ():
|
|||
*/
|
||||
String *arguments = createM3Signature (n);
|
||||
String *storage = Getattr (n, "storage");
|
||||
String *overridden = Getattr (n, "virtual:derived");
|
||||
String *overridden = Getattr (n, "override");
|
||||
bool isVirtual = (storage != NIL) && (Strcmp (storage, "virtual") == 0);
|
||||
bool isOverridden = (overridden != NIL)
|
||||
&& (Strcmp (overridden, "1") == 0);
|
||||
|
|
@ -2906,7 +2906,7 @@ MODULA3 ():
|
|||
Getattr (n, "feature:modula3:methodmodifiers"));
|
||||
if (static_flag)
|
||||
Printf (function_code, "static ");
|
||||
if (Getattr (n, "virtual:derived"))
|
||||
if (Getattr (n, "override"))
|
||||
Printf (function_code, "override ");
|
||||
else if (checkAttribute (n, "storage", "virtual"))
|
||||
Printf (function_code, "virtual ");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue