Enable given for anonymous function #22284
                  
                    
                      pocorall
                    
                  
                
                  started this conversation in
                Feature Requests
              
            Replies: 1 comment
-
| This is a FAQ. https://dotty.epfl.ch/docs/reference/contextual/more-givens.html#pattern-bound-given-instances-4 says  Possibly, this form makes sense because the type of the given is of primary interest. Secondarily, one may also bind a name,  | 
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.
-
First, let's see a toy example resembles an http server:
Style 1 works fine with Scala 3. However, it doesn't work with braceless syntax.
Style 2 is also works with Scala 3. However, it requires the variable
reqto be specified, and requires independentgivenclause.I hope Style 3 work. Is there any difficulties to support this syntax in future version of Scala?
Beta Was this translation helpful? Give feedback.
All reactions