
MT4・MT5 コンパイルエラー・警告 警告(コンパイルは通る)
call resolves to … due to new rules of method hiding
- エラー番号
warning 89- 意味
- メソッド隠蔽の新しいルールで、呼ばれる関数が変わった(MT5)
「call resolves to … due to new rules of method hiding」とは
継承したクラスで親クラスと同じ名前のメソッドを定義すると、親クラスの同名メソッドが隠されるようになった(MQL5 の新しいルール)ことを知らせる警告です。古いEAや標準ライブラリを使ったコードで、最近のビルドにすると出るようになりました。
MetaEditor での表示例
| MT5 | warning 89: call resolves to 'void B::f(double)' instead of 'void A::f(int)' due to new rules of method hiding |
|---|
実際のログでは先頭に「ファイル名(行,列) :」が付きます。ログの行をダブルクリックすると、エラーの場所にカーソルが移動します。表示は 2026年9月の MetaEditor で確認したもので、ビルドによって細部が変わることがあります。
「call resolves to … due to new rules of method hiding」の主な原因
- 子クラスで、親クラスと同じ名前・違う引数のメソッドを定義している
- 古いビルドを前提に書かれたクラスを、新しい MetaEditor でコンパイルした
「call resolves to … due to new rules of method hiding」の対処法
- 親クラスのメソッドを使いたい場合は、呼び出し側で A::f(1) のように明示する
- 子クラスに using 宣言や同名メソッドのオーバーロードを追加する
- 意図どおりの関数が呼ばれているなら、そのままでも動作する
関連するエラー
コンパイルエラー・警告の解説一覧
- undeclared identifier
- semicolon expected
- unexpected token
- unexpected token, probably type is missing?
- some operator expected
- unexpected end of program
- unbalanced parentheses
- closing quote '"' expected
- wrong parameters count
- function already defined and has body
- variable already defined
- function must have a body
- function not defined
- not all control paths return a value
- function must return a value
- expression of 'void' type is illegal
- event handling function not found
- function declared with wrong type or/and parameters
- possible loss of data due to type conversion
- truncation of constant value
- implicit conversion from 'number' to 'string'
- return value of 'OrderSend' should be checked
- declaration hides global variable
- l-value required
- constant cannot be modified
- constant expression required
- invalid index value
- array required
- arrays are passed by reference only
- parameter conversion not allowed
- illegal operation use
- illegal 'else' without matching 'if'
- 'break' must be used within some loop or switch statement
- case value already used
- ambiguous call to overloaded function
- can't open include file
- unknown property
- identifier already used
- struct member undefined
- struct or class type expected
- private member access error
- cannot instantiate abstract class
- structures or classes containing objects are not allowed
- function declarations are allowed on global, namespace or class scope only
- name expected
- division by zero in the constant expression
- expression has no effect
- expression not boolean
- sign mismatch
- possible use of uninitialized variable
- empty controlled statement found
- macro redefinition
- call resolves to … due to new rules of method hiding
- cannot be used for static allocated array












