metamodel: fix MMType::is_valid for indirect types
authorJean Privat <jean@pryen.org>
Thu, 25 Jun 2009 21:15:39 +0000 (17:15 -0400)
committerJean Privat <jean@pryen.org>
Thu, 25 Jun 2009 21:15:39 +0000 (17:15 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/metamodel/static_type.nit
src/metamodel/type_formal.nit

index 8d36232..c96a1b8 100644 (file)
@@ -373,6 +373,7 @@ end
 class MMNullableType
 special MMType
        attr _base_type: MMType
+       redef meth is_valid do return _base_type.is_valid
        redef meth is_nullable: Bool do return true
        redef meth as_notnull do return _base_type
        redef meth as_nullable do return self
index d4da2f5..987d4fd 100644 (file)
@@ -28,7 +28,7 @@ end
 # Formal types are named indirect types
 class MMTypeFormal
 special MMType
-       redef meth is_valid do return _bound != null
+       redef meth is_valid do return _bound != null and _bound.is_valid
 
        # The name of the type
        readable attr _name: Symbol