logo       

[jira] Commented: (BOO-314) Overeager member lookup in classes: msg#00103

lang.boo.devel

Subject: [jira] Commented: (BOO-314) Overeager member lookup in classes

[ http://jira.codehaus.org/browse/BOO-314?page=comments#action_47233 ]

steve donovan commented on BOO-314:
-----------------------------------

Thanks, Doug. This is the kind of thing which greatly helps normal use of Boo
by making it as suprise-free as possible.

Self-qualification is definitely acceptable in case of ambiguity.

steve d.


> Overeager member lookup in classes
> ----------------------------------
>
> Key: BOO-314
> URL: http://jira.codehaus.org/browse/BOO-314
> Project: Boo
> Type: Bug
> Components: Compiler
> Versions: 0.5
> Reporter: steve donovan
> Attachments: boo-314a.patch
>
>
> The compiler can get confused if there is a member of a class which has the
> same name as some symbol from an included namespace. In the first case, it
> is pointing out that 'Form.Size' can't be called, and is not looking up
> further for the 'System.Drawing.Size' constructor. In the second case, it
> sees 'Form.DialogResult' and notes that this is a static method, rather than
> 'System.Windows.Forms.DialogResult'.
> import System.Windows.Forms from System.Windows.Forms
> import System.Drawing from System.Windows.Forms
> class MyForm(Form):
> def constructor():
> // BCE0077: It is not possible to invoke an expression of type
> 'System.Drawing.Size'.
> Size = Size(200,200)
>
> static def go():
> f = MyForm()
> // BCE0058: Object required.
> if f.ShowDialog() == DialogResult.OK:
> print 'ok'
> The workaround is to fully qualify these names, but this is ugly and
> inconsistent. We know C# understands this issue properly, so a solution must
> be possible.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise