Ticket #208 (closed defect: fixed)
Dynamics not finding shared members (and it seems instance members too)
Reported by: | nevdelap | Owned by: | Chuck |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | Cobra Compiler | Version: | 0.8.0 |
Keywords: | Cc: |
Description
mono = Assembly.load('Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken?=0738eb9f132ed756')
Currently this throws Cobra.Lang.UnknownMemberException?
unixFileSystemInfo as dynamic? = mono.getType('Mono.Unix.UnixFileSystemInfo?')
fileInfo as dynamic? = unixFileSystemInfo.getFileSystemEntry('/usr/local/bin/cobra')
Workaround is to call invokeMethod...
unixFileSystemInfo2 as Type = mono.getType('Mono.Unix.UnixFileSystemInfo?')
fileInfo as dynamic? = unixFileSystemInfo2.invokeMember('GetFileSystemEntry?', BindingFlags?(Static, InvokeMethod?).InvokeMethod?, nil, nil, @[/usr/local/bin/cobra?])
The complete example program is in...
http://cobra-language.com/forums/viewtopic.php?f=4&t=628&p=3174#p3174