Skip to content

TP0231

Error: .NET member or type that Taipan can’t use

  • '<T>.<m>' uses <N>, which Taipan can't use yet (<N> the .NET type, e.g. Dictionary<string, int> or Func<int, bool>)
  • '<N>' can't be imported: generic .NET types aren't supported yet (M21, until M43)
  • '<N>[…]' is <T> in Taipan; write '<T>'
  • '<I>' has <the property '<p>'|the event '<e>'|an indexer|the generic method '<m>'|two methods named '<m>'>, which a Taipan class can't implement yet (M43)

From the golden case tests/cases/m21/tp0231_dotnet.tpn:

tp0231_dotnet.tpn
# .NET members using types Taipan can't use yet (SPEC §13.3). Since M43 generic types, decimal
# and object results are usable, so these use Int128 and a span.
from dotnet.System import Int128, MemoryExtensions
from dotnet.System.IO import File
let big = Int128.Parse("5")
let span = MemoryExtensions.AsSpan("abc")
print(len(File.ReadAllBytes("tests/cases/m21/tp0231_dotnet.tpn")) > 0)

The compiler reports:

tp0231_dotnet.tpn:6:18: error TP0231: 'Int128.Parse' uses Int128, which Taipan can't use yet
tp0231_dotnet.tpn:7:29: error TP0231: 'MemoryExtensions.AsSpan' uses Span<T>, which Taipan can't use yet

The specification lists every code.