Ignore type parameters #15472
                  
                    
                      Adam-Vandervorst
                    
                  
                
                  started this conversation in
                General Discussion
              
            Replies: 2 comments 6 replies
-
| To phrase in another way, Adam is looking for some type argument  
 
 | 
Beta Was this translation helpful? Give feedback.
                  
                    6 replies
                  
                
            -
| Reminiscent of https://en.wikipedia.org/wiki/The_Tholian_Web | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    




Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What do you do when a class/object is invariant under changes to a certain type parameter of its parent?
If you parameterise the child, then you can't use that same instance in multiple places (even though they're identical).
If you don't parameterise the child and use a wildcard, you run into variance issues.
Behold
fails on the last line with
An
asInstanceOfon thenotNothingobviously resolves this, but that doesn't feel as correct approach here.Beta Was this translation helpful? Give feedback.
All reactions