This repository was archived by the owner on Apr 14, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -101,7 +101,8 @@ private bool ProcessAbstractDecorators(IAnalysisSet decorator) {
101101
102102 // Only handle these if they are specialized
103103 foreach ( var d in decorator . OfType < SpecializedCallable > ( ) ) {
104- if ( d . DeclaringModule ? . ModuleName != "abc" ) {
104+ if ( d . DeclaringModule != null
105+ && d . DeclaringModule . ModuleName != "abc" ) {
105106 continue ;
106107 }
107108
Original file line number Diff line number Diff line change @@ -217,6 +217,8 @@ public override IEnumerable<ILocationInfo> Locations {
217217 }
218218 }
219219
220+ public override string Name => _original == null ? base . Name : this . _original . Name ;
221+
220222 public override IEnumerable < OverloadResult > Overloads {
221223 get {
222224 if ( _original == null ) {
Original file line number Diff line number Diff line change 33using System . Text ;
44using System . Threading . Tasks ;
55using Microsoft . Python . LanguageServer . Implementation ;
6+ using Microsoft . PythonTools . Analysis ;
67using Microsoft . PythonTools . Analysis . FluentAssertions ;
78using Microsoft . PythonTools . Interpreter ;
89using Microsoft . VisualStudio . TestTools . UnitTesting ;
910using TestUtilities ;
1011
11- namespace Microsoft . PythonTools . Analysis {
12+ namespace AnalysisTests {
1213 [ TestClass ]
1314 public class InheritanceTests {
1415 public TestContext TestContext { get ; set ; }
@@ -38,5 +39,30 @@ def virt():
3839 analysis . Should ( ) . HaveVariable ( "b" ) . OfType ( BuiltinTypeId . Int ) ;
3940 }
4041 }
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+ }
4167 }
4268}
Original file line number Diff line number Diff line change 11<Project >
22 <PropertyGroup >
33 <TargetFramework >netcoreapp2.1</TargetFramework >
4- <RootNamespace >Microsoft.PythonTools.Analysis </RootNamespace >
4+ <RootNamespace >AnalysisTests </RootNamespace >
55 <AssemblyName >Microsoft.Python.Analysis.Engine.Tests</AssemblyName >
66 </PropertyGroup >
77 <PropertyGroup >
You can’t perform that action at this time.
0 commit comments