6 Sep 21:04
[jira] Created: (BOO-1339) Generic constraint not correctly applied when type is declared on a field
Generic constraint not correctly applied when type is declared on a field
--------------------------------------------------------------------------
Key: BOO-1339
URL: https://jira.codehaus.org/browse/BOO-1339
Project: Boo
Issue Type: Bug
Components: Compiler
Affects Versions: 0.9.4
Environment: .NET 3.5 and 4.0, x64
Reporter: Giovanni Bassi
When you declare a field's type explicitly, if it's type is a generic class with a constraint, then under
certain conditions the type will no longer have the generic constraint, only the generic constraint remains.
This will not compile as expected, class Repository will be defined as Repository[of T] instead of
Repository[of T(Entity)]:
class Other:
rep as Repository of Entity = Repository of Entity()
class Repository[of T(Entity)]:
pass
class Entity:
pass
But if you leave the class Other at the bottom, it works as expected:
class Repository[of T(Entity)]:
pass
class Entity:
(Continue reading)
RSS Feed