Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ assertj_version = 3.21.0
junit_version = 5.8.2

# Version of published artifacts
version = 7.8.41
version = 7.8.42
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public static void prepareGlobalScope() {
SysMLv2Mill.addScalarValueTypes();
SysMLv2Mill.addCollectionTypes();
SysMLv2Mill.addTsynVariables();
SysMLv2Tool.loadStreamSymbolsFromJar();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ public void run(String[] args) {
}
}

public void loadStreamSymbolsFromJar() {
public static void loadStreamSymbolsFromJar() {
URL streamDefUrl = SysMLv2Tool.class.getClassLoader().getResource(
"Stream.symtabdefinitionsym");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ protected void calculateFieldAccessAboutPortUsage(SymTypeExpression type) {
var streamType = SysMLv2Mill.globalScope().resolveType("EventStream");
if(streamType.isEmpty()) {
Log.error("Stream not defined in global scope. Initialize it with 'SysMLv2Mill.addStreamType()'!");
getTypeCheckResult().setResult(SymTypeExpressionFactory.createObscureType());
return;
}
if (type instanceof SymTypeArray) {
//for example, type like boolean[], int[]...
Expand Down Expand Up @@ -158,7 +160,8 @@ protected void calculateFieldAccess(ASTFieldAccessExpression expr,
//in superclass is: getTypeCheckResult().setResult(type);
if (expr.getExpression() instanceof ASTNameExpression) {
//case for expression like f.a,f.a[1]
if (((ASTNameExpression) expr.getExpression()).getDefiningSymbol().get() instanceof PortUsage2VariableSymbolAdapter) {
var definingSymbol = ((ASTNameExpression) expr.getExpression()).getDefiningSymbol();
if (definingSymbol.isPresent() && definingSymbol.get() instanceof PortUsage2VariableSymbolAdapter) {
calculateFieldAccessAboutPortUsage(type);
} else {
//else-case for SuperClass
Expand All @@ -169,7 +172,8 @@ protected void calculateFieldAccess(ASTFieldAccessExpression expr,
var arrayExpr = expr.getExpression();
if (((ASTArrayAccessExpression) arrayExpr).getExpression() instanceof ASTNameExpression) {
var nameExpr = ((ASTArrayAccessExpression) arrayExpr).getExpression();
if (((ASTNameExpression) nameExpr).getDefiningSymbol().get() instanceof PortUsage2VariableSymbolAdapter) {
var definingSymbol = ((ASTNameExpression) nameExpr).getDefiningSymbol();
if (definingSymbol.isPresent() && definingSymbol.get() instanceof PortUsage2VariableSymbolAdapter) {
calculateFieldAccessAboutPortUsage(type);
} else {
//else-case for SuperClass
Expand Down
Loading