@@ -50,7 +50,7 @@ private newtype TExtractionProblem =
5050/**
5151 * Superclass for the extraction problem hierarchy.
5252 */
53- class ExtractionProblem extends TExtractionProblem {
53+ abstract class ExtractionProblem extends TExtractionProblem {
5454 /** Gets the string representation of the problem. */
5555 string toString ( ) { none ( ) }
5656
@@ -65,6 +65,9 @@ class ExtractionProblem extends TExtractionProblem {
6565
6666 /** Gets the SARIF severity of this problem. */
6767 int getSeverity ( ) { none ( ) }
68+
69+ /** Gets the `Compilation` the problem is associated with. */
70+ abstract Compilation getCompilation ( ) ;
6871}
6972
7073/**
@@ -96,6 +99,8 @@ class ExtractionUnrecoverableError extends ExtractionProblem, TCompilationFailed
9699 // [errors](https://docs.oasis-open.org/sarif/sarif/v2.1.0/csprd01/sarif-v2.1.0-csprd01.html#_Toc10541338).
97100 result = 2
98101 }
102+
103+ override Compilation getCompilation ( ) { result = c }
99104}
100105
101106/**
@@ -122,6 +127,8 @@ class ExtractionRecoverableWarning extends ExtractionProblem, TReportableWarning
122127 // [warnings](https://docs.oasis-open.org/sarif/sarif/v2.1.0/csprd01/sarif-v2.1.0-csprd01.html#_Toc10541338).
123128 result = 1
124129 }
130+
131+ override Compilation getCompilation ( ) { result = err .getCompilation ( ) }
125132}
126133
127134/**
@@ -148,4 +155,6 @@ class ExtractionUnknownProblem extends ExtractionProblem, TUnknownProblem {
148155 // [warnings](https://docs.oasis-open.org/sarif/sarif/v2.1.0/csprd01/sarif-v2.1.0-csprd01.html#_Toc10541338).
149156 result = 1
150157 }
158+
159+ override Compilation getCompilation ( ) { result = err .getCompilation ( ) }
151160}
0 commit comments