|
@@ -106,6 +106,9 @@ module FieldError = struct
|
|
let invalid_modifier_only com fctx m c p =
|
|
let invalid_modifier_only com fctx m c p =
|
|
maybe_display_error com fctx (Printf.sprintf "Invalid modifier: %s is only supported %s" m c) p
|
|
maybe_display_error com fctx (Printf.sprintf "Invalid modifier: %s is only supported %s" m c) p
|
|
|
|
|
|
|
|
+ let invalid_modifier_on_property com fctx m p =
|
|
|
|
+ maybe_display_error com fctx (Printf.sprintf "Invalid modifier: %s is not supported on properties" m) p
|
|
|
|
+
|
|
let missing_expression com fctx reason p =
|
|
let missing_expression com fctx reason p =
|
|
maybe_display_error com fctx (Printf.sprintf "%s" reason) p
|
|
maybe_display_error com fctx (Printf.sprintf "%s" reason) p
|
|
|
|
|
|
@@ -1631,9 +1634,10 @@ let init_field (ctx,cctx,fctx) f =
|
|
if not (has_class_flag c CExtern) && not (Meta.has Meta.Native f.cff_meta) then Typecore.check_field_name ctx name p;
|
|
if not (has_class_flag c CExtern) && not (Meta.has Meta.Native f.cff_meta) then Typecore.check_field_name ctx name p;
|
|
List.iter (fun acc ->
|
|
List.iter (fun acc ->
|
|
match (fst acc, f.cff_kind) with
|
|
match (fst acc, f.cff_kind) with
|
|
- | APublic, _ | APrivate, _ | AStatic, _ | AFinal, _ | AExtern, _ -> ()
|
|
|
|
|
|
+ | APublic, _ | APrivate, _ | AStatic, _ | AFinal, FVar _ | AFinal, FFun _ | AExtern, _ -> ()
|
|
| ADynamic, FFun _ | AOverride, FFun _ | AMacro, FFun _ | AInline, FFun _ | AInline, FVar _ | AAbstract, FFun _ | AOverload, FFun _ -> ()
|
|
| ADynamic, FFun _ | AOverride, FFun _ | AMacro, FFun _ | AInline, FFun _ | AInline, FVar _ | AAbstract, FFun _ | AOverload, FFun _ -> ()
|
|
| AEnum, (FVar _ | FProp _) -> ()
|
|
| AEnum, (FVar _ | FProp _) -> ()
|
|
|
|
+ | AFinal, FProp _ -> invalid_modifier_on_property ctx.com fctx (Ast.s_placed_access acc) (snd acc)
|
|
| _, FVar _ -> display_error ctx.com ("Invalid accessor '" ^ Ast.s_placed_access acc ^ "' for variable " ^ name) (snd acc)
|
|
| _, FVar _ -> display_error ctx.com ("Invalid accessor '" ^ Ast.s_placed_access acc ^ "' for variable " ^ name) (snd acc)
|
|
| _, FProp _ -> display_error ctx.com ("Invalid accessor '" ^ Ast.s_placed_access acc ^ "' for property " ^ name) (snd acc)
|
|
| _, FProp _ -> display_error ctx.com ("Invalid accessor '" ^ Ast.s_placed_access acc ^ "' for property " ^ name) (snd acc)
|
|
| _, FFun _ -> display_error ctx.com ("Invalid accessor '" ^ Ast.s_placed_access acc ^ "' for function " ^ name) (snd acc)
|
|
| _, FFun _ -> display_error ctx.com ("Invalid accessor '" ^ Ast.s_placed_access acc ^ "' for function " ^ name) (snd acc)
|