You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Parameterized types of generic classes sometimes shared between class instances #590
changed the title [-]Parameterized types of generics sometimes shared between intances[/-][+]Parameterized types of generics sometimes shared between instances[/+]on Feb 8, 2019
changed the title [-]Parameterized types of generics sometimes shared between instances[/-][+]Parameterized types of generic classes sometimes shared between class instances[/+]on Feb 8, 2019
OK, got it. The problem was that when specific type was created from template, it reused same method type instances since creation of the specific type just added references and then setting the result type set it to all specific types and the template.
Better solution is to remember supplied type arguments in the specific type (i.e. what the type was created from) and have function determine return type dynamically from them. This way we don't need to clone function type for the specific class. It is also provides better encapsulation since class type then knows less about its method type innards.
Similarly, dynamically serving return value documentation will eliminate issue that tooltip over method of the specific class shows -> _T.
In the below, both
intvalandstrvalcome to beint, even though hovering overboxedintandboxedstrshowBox[int]andBox[str]respectively.