Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#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)

Change History (2)

comment:1 by イグトランス (egtra), 16 years ago

Resolution: fixed
Status: newclosed

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

comment:2 by イグトランス (egtra), 16 years ago

[388]でコミット。

Note: See TracTickets for help on using tickets.