-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
get us to where we at least only get errors for redefined constructors
- Loading branch information
Showing
4 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
...ntime/src/main/java/org/enso/interpreter/runtime/error/RedefinedConstructorException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.enso.interpreter.runtime.error; | ||
|
||
import com.oracle.truffle.api.exception.AbstractTruffleException; | ||
import org.enso.interpreter.runtime.Module; | ||
|
||
/** An exception thrown when the program tries to redefine an already-defined constructor */ | ||
public class RedefinedConstructorException extends AbstractTruffleException { | ||
|
||
/** | ||
* Creates a new error. | ||
* | ||
* @param atom the method of the atom on which {@code method} is being defined | ||
*/ | ||
public RedefinedConstructorException(String atom, Module scope) { | ||
super("Constructors cannot be overloaded, but you have tried to overload " + atom + " in scope " + scope.getName()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters