File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -1293,12 +1293,15 @@ impl<'a> Compiler<'a> {
12931293 self . compile_block ( block, block_parameter, None )
12941294 }
12951295 ast:: Term :: Function ( func) => {
1296- if value_type. is_some ( ) {
1297- return Err ( Error :: FeatureUnsupported (
1298- "Function cannot be applied to value" . to_string ( ) ,
1299- ) ) ;
1296+ // Compile the function itself
1297+ let function_type = self . compile_function ( func) ?;
1298+
1299+ // If a value is being piped to it, apply the value
1300+ if let Some ( val_type) = value_type {
1301+ self . apply_value_to_type ( function_type, val_type)
1302+ } else {
1303+ Ok ( function_type)
13001304 }
1301- self . compile_function ( func)
13021305 }
13031306 ast:: Term :: Access ( access) => {
13041307 match & access. identifier {
Original file line number Diff line number Diff line change @@ -165,3 +165,10 @@ fn test_function_parameter_contravariance() {
165165 "# ,
166166 ) ;
167167}
168+
169+ #[ test]
170+ fn test_apply_value_to_inline_function ( ) {
171+ quiver ( )
172+ . evaluate ( "5 ~> #int { ~> [~, 2] ~> <add> }" )
173+ . expect ( "7" ) ;
174+ }
You can’t perform that action at this time.
0 commit comments