History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BOO-287
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Rodrigo B. de Oliveira
Reporter: Peter Johanson
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

Properties with same name as property type cause compiler error

Created: 08/Apr/05 02:31 PM   Updated: 19/Oct/05 03:25 PM
Component/s: Compiler
Affects Version/s: 0.5
Fix Version/s: 0.7.5

Time Tracking:
Not Specified

Environment: 0.5.3 release on mono-1.1.6
Issue Links:
Duplicate
 


 Description  « Hide
The following sample fails to compile:
import System

class Prop:
[Property(Object)]
o = Object()

p = Prop()

Changing the name of the property to "Objec" makes it compile fine. Changing the name of the property to any other type in System is fine. Changing both the Property name to "Array" and the o assignment to "o = Array()" causes the same error.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order

Doug H - 08/Apr/05 02:51 PM
Yeah the boo compiler can't infer the type when it is recursive, too:

import System

class Prop:
o = Blah //o as object = Blah will work
Blah:
get:
return o
set:
o = value

So this might be just something you have to workaround by declaring the type "o as object = ..."


Daniel Grunwald - 08/Apr/05 02:54 PM
Let's see this issue as a vote for supporting

import System.Windows.Forms
class MainForm(Form):
def constructor():
Size = Size(10, 10)


Doug H - 08/Apr/05 03:00 PM
We should create a new jira issue then or change the title of this one.

Feature request: inferring correct type when two types are of same name but one is callable (or a type you are invoking) and the other is not (an instance)