-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bugs in function signature type checking.
Bug: issue #992 Test: new test cases
- Loading branch information
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
typedef CallbackCell = function void (any value); | ||
typedef CallbackRef = function void (any &value); | ||
|
||
public void OnPluginStart() | ||
{ | ||
// 4 tests below does report error in 1.11 | ||
|
||
CallbackCell badcellany = RefAny; // no error | ||
ReturnFunction(badcellany); | ||
|
||
CallbackCell badcellint = RefInt; // no error | ||
ReturnFunction(badcellint); | ||
|
||
CallbackRef badrefany = CellAny; // no error | ||
ReturnFunction(badrefany); | ||
|
||
CallbackRef badrefint = CellInt; // error | ||
ReturnFunction(badrefint); | ||
} | ||
|
||
void CellAny(any value) {} | ||
void CellInt(int value) {} | ||
void RefAny(any &value) {} | ||
void RefInt(int &value) {} | ||
|
||
Function ReturnFunction(Function func) | ||
{ | ||
return func; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(8) : error 100: function prototypes do not match | ||
(11) : error 100: function prototypes do not match | ||
(14) : error 100: function prototypes do not match | ||
(17) : error 100: function prototypes do not match |