This repository was archived by the owner on Apr 14, 2022. It is now read-only.
File tree 4 files changed +32
-3
lines changed
4 files changed +32
-3
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,8 @@ private bool ProcessAbstractDecorators(IAnalysisSet decorator) {
101
101
102
102
// Only handle these if they are specialized
103
103
foreach ( var d in decorator . OfType < SpecializedCallable > ( ) ) {
104
- if ( d . DeclaringModule ? . ModuleName != "abc" ) {
104
+ if ( d . DeclaringModule != null
105
+ && d . DeclaringModule . ModuleName != "abc" ) {
105
106
continue ;
106
107
}
107
108
Original file line number Diff line number Diff line change @@ -217,6 +217,8 @@ public override IEnumerable<ILocationInfo> Locations {
217
217
}
218
218
}
219
219
220
+ public override string Name => _original == null ? base . Name : this . _original . Name ;
221
+
220
222
public override IEnumerable < OverloadResult > Overloads {
221
223
get {
222
224
if ( _original == null ) {
Original file line number Diff line number Diff line change 3
3
using System . Text ;
4
4
using System . Threading . Tasks ;
5
5
using Microsoft . Python . LanguageServer . Implementation ;
6
+ using Microsoft . PythonTools . Analysis ;
6
7
using Microsoft . PythonTools . Analysis . FluentAssertions ;
7
8
using Microsoft . PythonTools . Interpreter ;
8
9
using Microsoft . VisualStudio . TestTools . UnitTesting ;
9
10
using TestUtilities ;
10
11
11
- namespace Microsoft . PythonTools . Analysis {
12
+ namespace AnalysisTests {
12
13
[ TestClass ]
13
14
public class InheritanceTests {
14
15
public TestContext TestContext { get ; set ; }
@@ -38,5 +39,30 @@ def virt():
38
39
analysis . Should ( ) . HaveVariable ( "b" ) . OfType ( BuiltinTypeId . Int ) ;
39
40
}
40
41
}
42
+
43
+ [ TestMethod ]
44
+ public async Task AbstractPropertyReturnTypeIgnored ( ) {
45
+ var code = @"
46
+ import abc
47
+
48
+ class A:
49
+ @abc.abstractproperty
50
+ def virt():
51
+ pass
52
+
53
+ class B(A):
54
+ @property
55
+ def virt():
56
+ return 42
57
+
58
+ a = A()
59
+ b = a.virt" ;
60
+
61
+ using ( var server = await new Server ( ) . InitializeAsync ( PythonVersions . Required_Python36X ) ) {
62
+ var analysis = await server . OpenDefaultDocumentAndGetAnalysisAsync ( code ) ;
63
+
64
+ analysis . Should ( ) . HaveVariable ( "b" ) . OfType ( BuiltinTypeId . Int ) ;
65
+ }
66
+ }
41
67
}
42
68
}
Original file line number Diff line number Diff line change 1
1
<Project >
2
2
<PropertyGroup >
3
3
<TargetFramework >netcoreapp2.1</TargetFramework >
4
- <RootNamespace >Microsoft.PythonTools.Analysis </RootNamespace >
4
+ <RootNamespace >AnalysisTests </RootNamespace >
5
5
<AssemblyName >Microsoft.Python.Analysis.Engine.Tests</AssemblyName >
6
6
</PropertyGroup >
7
7
<PropertyGroup >
You can’t perform that action at this time.
0 commit comments