Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix sym-type-void not having an enclosing scope #64

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,15 @@ public static SymTypeOfRegEx createTypeRegEx(String regex) {

/**
* creates the "Void"-type, i.e. a pseudotype that represents the absence of a real type
*
* @return
*/
public static SymTypeVoid createTypeVoid() {
return new SymTypeVoid();
Optional<TypeSymbol> type = BasicSymbolsMill.globalScope()
.resolveTypeLocally(BasicSymbolsMill.VOID);
if (type.isEmpty()) {
Log.error("0x893F63 Internal Error: Non primitive type "
+ BasicSymbolsMill.VOID + " stored as constant.");
}
return new SymTypeVoid(type.orElseThrow());
}

public static SymTypeObscure createObscureType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@


import de.monticore.symbols.basicsymbols.BasicSymbolsMill;
import de.monticore.symbols.basicsymbols._symboltable.TypeSymbol;
import de.monticore.symbols.basicsymbols._symboltable.TypeSymbolSurrogate;
import de.monticore.types3.ISymTypeVisitor;

Expand All @@ -16,6 +17,10 @@ public SymTypeVoid() {
typeSymbol = new TypeSymbolSurrogate(BasicSymbolsMill.VOID);
typeSymbol.setEnclosingScope(BasicSymbolsMill.scope());
}

protected SymTypeVoid(TypeSymbol symbol) {
this.typeSymbol = symbol;
}

@Override
public boolean isVoidType() {
Expand Down
Loading