Skip to content

Commit

Permalink
Allow final properties for java externs
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Sep 15, 2023
1 parent 0972725 commit 5f4fc58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/typing/typeloadFields.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1634,10 +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;
List.iter (fun acc ->
match (fst acc, f.cff_kind) with
| APublic, _ | APrivate, _ | AStatic, _ | AFinal, FVar _ | AFinal, FFun _ | AExtern, _ -> ()
| AFinal, FProp _ when not (has_class_flag c CExtern) && ctx.com.platform <> Java -> invalid_modifier_on_property ctx.com fctx (Ast.s_placed_access acc) (snd acc)
| APublic, _ | APrivate, _ | AStatic, _ | AFinal, _ | AExtern, _ -> ()
| ADynamic, FFun _ | AOverride, FFun _ | AMacro, FFun _ | AInline, FFun _ | AInline, FVar _ | AAbstract, FFun _ | AOverload, FFun _ -> ()
| 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)
| _, 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)
Expand Down

0 comments on commit 5f4fc58

Please sign in to comment.