@@ -83,6 +83,13 @@ module TestForwardMethods
83
83
@test ForwardMethods. has_defined_interface (SettableProperties, Val (:getfields ))
84
84
@test ForwardMethods. has_defined_interface (SettableProperties, Val (:setfields ))
85
85
86
+ mutable struct SettablePropertiesNoKey2Key3
87
+ key1:: String
88
+ key2:: Int
89
+ key3:: Bool
90
+ end
91
+ @define_interface SettablePropertiesNoKey2Key3 interface= (getfields, setfields) omit= (key2, key3)
92
+
86
93
mutable struct CompositeProperties
87
94
settable:: SettableProperties
88
95
key4:: Float64
@@ -430,5 +437,20 @@ module TestForwardMethods
430
437
e = EqualityUsingProperties (Dict (:a => 1 ))
431
438
@Test e == EqualityUsingProperties (Dict (:a => 1 ))
432
439
@Test e != EqualityUsingProperties (Dict (:a => 1 , :b => 2 ))
440
+
441
+ @test hasmethod (key1, Tuple{SettableProperties})
442
+ @test hasmethod (key1!, Tuple{SettableProperties, String})
443
+ @test hasmethod (key2, Tuple{SettableProperties})
444
+ @test hasmethod (key2!, Tuple{SettableProperties, Int})
445
+ @test hasmethod (key3, Tuple{SettableProperties})
446
+ @test hasmethod (key3!, Tuple{SettableProperties, Bool})
447
+
448
+ @test hasmethod (key1, Tuple{SettablePropertiesNoKey2Key3})
449
+ @test hasmethod (key1!, Tuple{SettablePropertiesNoKey2Key3, String})
450
+ @test ! hasmethod (key2, Tuple{SettablePropertiesNoKey2Key3})
451
+ @test ! hasmethod (key2!, Tuple{SettablePropertiesNoKey2Key3, Int})
452
+ @test ! hasmethod (key3, Tuple{SettablePropertiesNoKey2Key3})
453
+ @test ! hasmethod (key3!, Tuple{SettablePropertiesNoKey2Key3, Bool})
454
+
433
455
end
434
456
end
0 commit comments