1 /*
2 * Copyright (c) 2021 - 2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include "typeConverter.h"
17
18 namespace ark::es2panda::checker {
TypeConverter(ETSChecker * checker,TypeRelation * relation,Type * target,Type * source)19 TypeConverter::TypeConverter(ETSChecker *checker, TypeRelation *relation, Type *target, Type *source)
20 : checker_(checker), relation_(relation), target_(target), source_(source)
21 {
22 }
23
Result() const24 Type *TypeConverter::Result() const
25 {
26 return result_;
27 }
28
SetResult(Type * result)29 void TypeConverter::SetResult(Type *result)
30 {
31 result_ = result;
32 }
33
Source() const34 Type *TypeConverter::Source() const
35 {
36 return source_;
37 }
38
Target() const39 Type *TypeConverter::Target() const
40 {
41 return target_;
42 }
43
Relation() const44 TypeRelation *TypeConverter::Relation() const
45 {
46 return relation_;
47 }
48
Checker() const49 ETSChecker *TypeConverter::Checker() const
50 {
51 return checker_;
52 }
53 } // namespace ark::es2panda::checker
54