Skip to content

Commit 1a24827

Browse files
committed
Add case for cvar with singleton attr_accessor
1 parent 6992ea0 commit 1a24827

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/rbs/definition_builder_test.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2730,6 +2730,12 @@ class InstanceVariableAttrInstanceVariable
27302730
@instance: Integer
27312731
end
27322732
2733+
class ClassInstanceVariableSingletonAttrClassInstanceVariable
2734+
self.@class_instance: Integer
2735+
attr_accessor self.class_instance: Integer
2736+
self.@class_instance: Integer
2737+
end
2738+
27332739
class ClassInstanceVariable
27342740
self.@class_instance: Integer
27352741
self.@class_instance: Integer
@@ -2756,6 +2762,9 @@ class ClassVariable
27562762
assert_raises(RBS::InstanceVariableDuplicationError) do
27572763
builder.build_instance(type_name("::InstanceVariableAttrInstanceVariable"))
27582764
end
2765+
assert_raises(RBS::ClassInstanceVariableDuplicationError) do
2766+
builder.build_singleton(type_name("::ClassInstanceVariableSingletonAttrClassInstanceVariable"))
2767+
end
27592768
assert_raises(RBS::ClassInstanceVariableDuplicationError) do
27602769
builder.build_singleton(type_name("::ClassInstanceVariable"))
27612770
end

0 commit comments

Comments
 (0)