File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
main/java/org/sonar/python/semantic/v2/converter
test/java/org/sonar/python/types/v2 Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 24
24
import org .sonar .python .index .VariableDescriptor ;
25
25
import org .sonar .python .types .v2 .ObjectType ;
26
26
import org .sonar .python .types .v2 .PythonType ;
27
- import org .sonar .python .types .v2 .TypeWrapper ;
28
27
29
28
public class VariableDescriptorToPythonTypeConverter implements DescriptorToPythonTypeConverter {
30
29
31
30
public PythonType convert (ConversionContext ctx , VariableDescriptor from ) {
32
- var typeWrapper = Optional .ofNullable (from .annotatedType ())
31
+ return Optional .ofNullable (from .annotatedType ())
33
32
.map (fqn -> ctx .lazyTypesContext ().getOrCreateLazyTypeWrapper (fqn ))
34
- .orElse ( TypeWrapper . UNKNOWN_TYPE_WRAPPER );
35
- return new ObjectType ( typeWrapper );
33
+ .map ( t -> ( PythonType ) new ObjectType ( t ))
34
+ . orElse ( PythonType . UNKNOWN );
36
35
}
37
36
38
37
@ Override
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ void imported_unknown2() {
66
66
var etreeType = ((ModuleType ) ((ExpressionStatement ) fileInput .statements ().statements ().get (1 )).expressions ().get (0 ).typeV2 ());
67
67
assertThat (etreeType .name ()).isEqualTo ("xml" );
68
68
assertThat (etreeType .resolveSubmodule ("etree" )).isEmpty ();
69
- assertThat (etreeType .resolveMember ("etree" ).get (). unwrappedType () ).isInstanceOf (UnknownType .UnknownTypeImpl .class );
69
+ assertThat (etreeType .resolveMember ("etree" ).get ()).isInstanceOf (UnknownType .UnknownTypeImpl .class );
70
70
}
71
71
72
72
@ Test
You can’t perform that action at this time.
0 commit comments