You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Invalid cast from BuiltinFunctionInfo to BuiltinClassInfo in GetBuiltinType #470
[Error - 5:37:55 PM] System.InvalidCastException: Unable to cast object of type 'Microsoft.PythonTools.Analysis.Values.BuiltinFunctionInfo' to type 'Microsoft.PythonTools.Analysis.Values.BuiltinClassInfo'.
at Microsoft.PythonTools.Analysis.PythonAnalyzer.GetBuiltinType(IPythonType type)
at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
at System.Collections.Generic.List`1.AddEnumerable(IEnumerable`1 enumerable)
at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
at Microsoft.PythonTools.Analysis.Values.Mro..ctor(IEnumerable`1 values)
at Microsoft.PythonTools.Analysis.Values.BuiltinClassInfo.get_Mro()
at Microsoft.PythonTools.Analysis.Values.Mro.Recompute()
at Microsoft.PythonTools.Analysis.Values.ClassInfo.SetBases(IEnumerable`1 bases)
at Microsoft.PythonTools.Analysis.ClassAnalysisUnit.AnalyzeWorker(DDG ddg, CancellationToken cancel)
at Microsoft.PythonTools.Analysis.Analyzer.DDG.Analyze(Deque`1 queue, CancellationToken cancel, Action`1 reportQueueSize, Int32 reportQueueInterval)
at Microsoft.PythonTools.Analysis.PythonAnalyzer.AnalyzeQueuedEntries(CancellationToken cancel)
at Microsoft.PythonTools.Intellisense.AnalysisQueue.GroupAnalysis.Analyze(CancellationToken cancel)
at Microsoft.PythonTools.Intellisense.AnalysisQueue.HandleAnalyzable(IAnalyzable item, AnalysisPriority priority, CancellationToken cancellationToken)
at Microsoft.PythonTools.Intellisense.AnalysisQueue.ConsumerLoop()
#439 changed a bunch of the MRO stuff, and that PR's timing lines up with when Josh Smeaton (@jarshwah) saw this.
It seems to me like either:
We now add more things to the MRO, which the (older) GetBuiltinType method needs to better handle.
The check in GetBuiltinType is correct, and the new code adds things it shouldn't to the MRO.
Activity
MikhailArkhipov commentedon Dec 10, 2018
Looks like function somehow leaked into SetBases. MRO should technically only contain classes so the direct cast fails.
Fix #470 (#478)
Fix microsoft#470 (microsoft#478)
Cherry pick fixes from Release branch into PTVS branch (#578)
Output syntax errors from the parser (#584)
Report unresolved imports (#593)
De-duplicate completions (#602)
Port import tests from old LS (#606)
Resolve issue when specific types shared data after creation off gene…
Resolve issue when specific types shared data after creation off gene…
Add dependency resolution to the analyzer (#621)
Fix microsoft#470 (microsoft#478)
Output syntax errors from the parser (microsoft#584)
Report unresolved imports (microsoft#593)
De-duplicate completions (microsoft#602)
Port import tests from old LS (microsoft#606)
Resolve issue when specific types shared data after creation off gene…
Add dependency resolution to the analyzer (microsoft#621)