# Current closure declarations
readable writable var _closure_decls: Array[AClosureDecl] = new Array[AClosureDecl]
+ # True is a problen occured durring building
+ readable writable var _has_error_occured: Bool = false
+
# Current signature
readable writable var _signature: nullable MMSignature = null
end
var supers = prop.local_class.super_methods_named(prop.name)
inherit_signature(v, prop, supers)
end
- if prop.signature != null then
+ if prop.signature != null or v.signature_builder.has_error_occured then
# ok
else if not v.signature_builder.untyped_params.is_empty then
v.error(v.signature_builder.untyped_params.first, "Error: Untyped parameter.")
v.signature_builder = new SignatureBuilder
super
+ if v.signature_builder.has_error_occured then return
+
if v.signature_builder.signature == null then
#_method.signature = new MMSignature(new Array[MMType], null, v.local_class.get_type)
else
redef fun accept_property_verifier(v)
do
super
- if not v.signature_builder.untyped_params.is_empty then
+ if v.signature_builder.has_error_occured then
+ return
+ else if not v.signature_builder.untyped_params.is_empty then
if v.signature_builder.untyped_params.first != v.signature_builder.params.first or n_type != null then
v.error(v.signature_builder.untyped_params.first, "Syntax error: untyped parameter.")
return
var ret: nullable MMType = null
if n_type != null then
ret = n_type.get_stype(v)
+ if ret == null then
+ v.signature_builder.has_error_occured = true
+ return
+ end
end
v.signature_builder.signature = new MMSignature(pars, ret, v.local_class.get_type)
if v.signature_builder.vararg_rank >= 0 then
v.signature_builder.params.add(self)
v.signature_builder.untyped_params.add(self)
if n_type != null then
- var stype = n_type.get_stype(v).as(not null)
+ var stype = n_type.get_stype(v)
+ if stype == null then
+ v.signature_builder.has_error_occured = true
+ return
+ end
for p in v.signature_builder.untyped_params do
p.stype = stype
if is_vararg then
var old_signature_builder = v.signature_builder
v.signature_builder = new SignatureBuilder
super
+ if v.signature_builder.has_error_occured then
+ return
+ end
var sig = v.signature_builder.signature
if sig == null then
sig = new MMSignature(new Array[MMType], null, v.local_class.get_type)
--- /dev/null
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Copyright 2009 Jean Privat <jean@pryen.org>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#alt1#class Fail[E]
+#alt1#end
+
+class E
+ type T: Fail
+end
+
+class F
+ type T: Array[Fail]
+end
+
+class G
+ readable writable var _a: Fail
+ fun ma(a: Fail) do return
+ fun mb(a: Array[Fail]) do return
+ fun mc: Fail do return 0
+ fun md: Array[Fail] do return 0
+end
+
--- /dev/null
+./error_type_not_ok4.nit:25,16: Type error: class Fail not found in module error_type_not_ok4.
+./error_type_not_ok4.nit:29,28: Type error: class Fail not found in module error_type_not_ok4.
+./error_type_not_ok4.nit:30,12: Type error: class Fail not found in module error_type_not_ok4.
+./error_type_not_ok4.nit:31,18: Type error: class Fail not found in module error_type_not_ok4.
+./error_type_not_ok4.nit:32,10: Type error: class Fail not found in module error_type_not_ok4.
+./error_type_not_ok4.nit:33,16: Type error: class Fail not found in module error_type_not_ok4.
+./error_type_not_ok4.nit:21,10: Type error: class Fail not found in module error_type_not_ok4.
--- /dev/null
+alt/error_type_not_ok4_alt1.nit:21,10--13: Type error: 'Fail' is a generic class.
+alt/error_type_not_ok4_alt1.nit:25,16--19: Type error: 'Fail' is a generic class.
+alt/error_type_not_ok4_alt1.nit:29,28--31: Type error: 'Fail' is a generic class.
+alt/error_type_not_ok4_alt1.nit:30,12--15: Type error: 'Fail' is a generic class.
+alt/error_type_not_ok4_alt1.nit:31,18--21: Type error: 'Fail' is a generic class.
+alt/error_type_not_ok4_alt1.nit:32,10--13: Type error: 'Fail' is a generic class.
+alt/error_type_not_ok4_alt1.nit:33,16--19: Type error: 'Fail' is a generic class.