[Mono-bugs] [Bug 437623] Late binding works incorrect sometimes

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Oct 28 07:40:11 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=437623

User info at aulix.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=437623#c7





--- Comment #7 from Alexander Prokopyev <info at aulix.com>  2008-10-28 05:40:09 MDT ---
Rolf, I have tried the latest build from SVN. Yes, M issue has been fixed.

But may be I have found another late binding bug. After changing my script to:
For Each CI as Object In C
   Console.WriteLine(CI.Value)
Next

It generates an error:
root ~ > /utils/FindUniqueHosts.vb tcpdump_dns.txt

Unhandled Exception: System.Reflection.TargetInvocationException: Exception has
been thrown by the target of an invocation. ---> System.Refl
ection.TargetInvocationException: Exception has been thrown by the target of an
invocation. ---> System.NullReferenceException: Object refer
ence not set to an instance of an object
  at System.Text.RegularExpressions.Regex.Match (System.String input, Int32
startat) [0x00000]
  at System.Text.RegularExpressions.Regex.Matches (System.String input, Int32
startat) [0x00000]
  at System.Text.RegularExpressions.Regex.Matches (System.String input)
[0x00000]
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke
(object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] param
eters, System.Globalization.CultureInfo culture) [0x00000]
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] param
eters, System.Globalization.CultureInfo culture) [0x00000]
  at System.MonoType.InvokeMember (System.String name, BindingFlags invokeAttr,
System.Reflection.Binder binder, System.Object target, Syste
m.Object[] args, System.Reflection.ParameterModifier[] modifiers,
System.Globalization.CultureInfo culture, System.String[] namedParameters)
 [0x00000]
  at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet (System.Object
o, System.Type objType, System.String name, System.Object[] a
rgs, System.String[] paramnames, System.Boolean[] CopyBack) [0x00000]
  at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet
(System.Object Instance, System.Type Type, System.String MemberName, Syst
em.Object[] Arguments, System.String[] ArgumentNames, System.Type[]
TypeArguments, System.Boolean[] CopyBack) [0x00000]
  at MainModule.Main (System.Collections.ObjectModel.ReadOnlyCollection`1 Args)
[0x00000]
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke
(object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] param
eters, System.Globalization.CultureInfo culture) [0x00000]
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] param
eters, System.Globalization.CultureInfo culture) [0x00000]
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[]
parameters) [0x00000]
  at ScriptingHost.Module1.Main () [0x00000]




Note that declaring CI in advance works fine:
dim CI
For Each CI In C
   Console.WriteLine(CI.Value)
Next

There is another incompatibility with VB9, not sure may it is too early to ask
for its fix. VB9 does not require to declare "For cycle" variables.

In VB9 it is allowed to write without dim in advance:
For Each CI In C
   Console.WriteLine(CI)
Next


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list