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 has been archived by the owner on Sep 14, 2018. It is now read-only.
The code in the bottom raise the exception [ ** unsupported operand type(s)
for -: 'indexer#' and 'int' ** ] if I use the expression with the call for
prop1
Option Explicit On
Option Strict On
Imports Microsoft.Scripting.Hosting
Imports IronPython.Hosting
Imports Microsoft.Scripting
Public Class TestObject
Public ReadOnly Property prop1(Optional param As Double = 10) As Double
Get
Return param * 9
End Get
End Property
Public ReadOnly Property prop2 As Double
Get
Return 999
End Get
End Property
End Class
Module Module1
Sub Main()
Dim obj As TestObject = New TestObject
Dim engine As ScriptEngine = Python.CreateEngine()
Dim scope As ScriptScope = engine.CreateScope()
scope.SetVariable("obj", obj)
Dim expression As CompiledCode = engine.CreateScriptSourceFromString("test = obj.prop1 - 11", SourceCodeKind.Statements).Compile()
'Dim expression As CompiledCode = engine.CreateScriptSourceFromString("test = obj.prop2 - 11", SourceCodeKind.Statements).Compile()
expression.Execute(scope)
Dim ret As Double = CType(scope.GetVariable("test"), Double)
Console.WriteLine("returned value from python: " & ret)
Console.ReadLine()
End Sub
End Module
Work Item Details
Original CodePlex Issue:Issue 35722 Status: Proposed Reason Closed: Unassigned Assigned to: Unassigned Reported on: Dec 2 at 10:30 PM Reported by: nsstl Updated on: Dec 2 at 10:30 PM Updated by: nsstl
The text was updated successfully, but these errors were encountered:
The code in the bottom raise the exception [ ** unsupported operand type(s)
for -: 'indexer#' and 'int' ** ] if I use the expression with the call for
prop1
Work Item Details
Original CodePlex Issue: Issue 35722
Status: Proposed
Reason Closed: Unassigned
Assigned to: Unassigned
Reported on: Dec 2 at 10:30 PM
Reported by: nsstl
Updated on: Dec 2 at 10:30 PM
Updated by: nsstl
The text was updated successfully, but these errors were encountered: