← Winnitude! Search  ·  Reader Mode (758 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 9 LINKS

NullReferenceException when non-generic type is given type parameters · Issue #1325 · pythonnet/pythonnet

Repository navigation

NullReferenceException when non-generic type is given type parameters  #1325


New issue

New issue

Closed
#1326
Closed
NullReferenceException when non-generic type is given type parameters #1325 #1326

Description

@tminka's profile tminka opened on Dec 17, 2020

Environment

  • Pythonnet version: latest git commit
  • Python version: 3.7
  • Operating System: Windows 10 64-bit

Details

The following incorrect Python code produces a confusing NullReferenceException, instead of a more helpful error message:

from System.Collections import IList
IList[bool]
  • If there was a crash, please include the traceback here.
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at Python.Runtime.GenericUtil.GenericByName(String ns, String name, Int32 paramCount)
   at Python.Runtime.ClassBase.type_subscript(IntPtr idx)

A more helpful message would be: System.Collections.IList is not a generic type

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions