diff options
author | svenbarth <svenbarth@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2021-04-18 14:01:09 +0000 |
---|---|---|
committer | svenbarth <svenbarth@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2021-04-18 14:01:09 +0000 |
commit | e671ec0a81414c6a568fec0653f9d82202e0d95f (patch) | |
tree | 697ca03691d315c33176670f4f72ece4962fc0a5 /tests/webtbf/tw38771.pp | |
parent | c9d8f8a378ad21ab2b306d2103390f2a2725f558 (diff) | |
download | fpc-e671ec0a81414c6a568fec0653f9d82202e0d95f.tar.gz |
* fix for Mantis #38771: the owner of the procdef might be Nil in case of a specialization (that virtual can't be used on generics is caught later on)
+ added test
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@49228 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'tests/webtbf/tw38771.pp')
-rw-r--r-- | tests/webtbf/tw38771.pp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/webtbf/tw38771.pp b/tests/webtbf/tw38771.pp new file mode 100644 index 0000000000..1d041847a2 --- /dev/null +++ b/tests/webtbf/tw38771.pp @@ -0,0 +1,22 @@ +{ %FAIL } +{$mode objfpc} + +program tw38771; + +type + TMyClass = class + generic procedure DoThis<T>(msg: T); + generic procedure DoThat<T>(msg: T); virtual; + end; + +generic procedure TMyClass.DoThis<T>(msg:T); +begin + specialize DoThat<T>(msg); +end; + +generic procedure TMyClass.DoThat<T>(msg: T); +begin +end; + +begin +end. |