File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,22 @@ function add_meta_construction(e::Expr)
3434 return __meta__
3535 end
3636 end
37+ elseif @capture (
38+ e, (function m_name_ (m_args__; m_kwargs__) where {m_where_args__}
39+ c_body_
40+ end ) | (function m_name_ (m_args__) where {m_where_args__}
41+ c_body_
42+ end )
43+ )
44+ m_kwargs = m_kwargs === nothing ? [] : m_kwargs
45+ return quote
46+ $ (c_body_string_symbol):: String = $ (c_body_string)
47+ function $m_name ($ (m_args... ); $ (m_kwargs... )) where {$ (m_where_args... )}
48+ __meta__ = GraphPPL. MetaSpecification ($ (c_body_string_symbol))
49+ $ c_body
50+ return __meta__
51+ end
52+ end
3753 else
3854 return quote
3955 $ (c_body_string_symbol):: String = $ (c_body_string)
Original file line number Diff line number Diff line change 386386 end
387387 @test_expression_generating meta_macro_interior (input) output
388388end
389+
390+ @testitem " meta_macro_interior_with_where" begin
391+ import GraphPPL: meta_macro_interior
392+
393+ include (" ../../testutils.jl" )
394+
395+ @meta function make_learning_meta (f:: F ) where {F}
396+ ContinuousTransition () -> CTMeta (f)
397+ end
398+
399+ @meta function make_learning_meta (f:: F , b:: G ; a:: G ) where {F, G}
400+ ContinuousTransition () -> CTMeta (f)
401+ end
402+
403+ @test length (methods (make_learning_meta)) == 2
404+ end
You can’t perform that action at this time.
0 commit comments