#147 closed タスク (fixed)
派生クラスの例外を基底クラス型で受け取れない。
| Reported by: | イグトランス (egtra) | Owned by: | イグトランス (egtra) |
|---|---|---|---|
| Priority: | 高-critical | Milestone: | AB5 CP6 |
| Component: | ablib | Version: | |
| Keywords: | 例外処理 | Cc: |
Description
次のプログラムでCatch As Exceptionという出力がなされない。ステップ実行してもCatch内に入らない。
#console
Imports System
Try
Throw New SystemException("SystemException") 'SystemExceptionはExceptionの派生クラス
Catch e As Exception
Print "Catch As Exception"
End Try
Sleep(-1)
次のプログラムでは、Catch As SystemExceptionが出力される。Catch節を上から順に見て、最初に見付かるSystemExceptionをCatch可能なCatch節として、Catch e As Exception以下へ制御が移るようにすべき。
#console
Imports System
Try
Throw New SystemException("aa")
Catch e As Exception
Print "Catch As Exception"
Catch e As SystemException
Print "Catch As SystemException"
End Try
Sleep(-1)
Note:
See TracTickets
for help on using tickets.

system/exception.abの修正で解決した。